title: When I try to call LocationClient.connect(), I got NumberFormatException
body: <p>I download the project example from google(LocationUpdates.zip, <a href="http://developer.android.com/training/location/retrieve-current.html" rel="nofollow noreferrer">http://developer.android.com/training/location/retrieve-current.html</a>).
  When I ran it, it showed the exception as follows, but not always:</p>
  
  <pre><code>08-10 16:10:34.119: W/System.err(26914): java.lang.NumberFormatException: Invalid int: ""
  08-10 16:10:34.127: W/System.err(26914):    at java.lang.Integer.invalidInt(Integer.java:138)
  08-10 16:10:34.127: W/System.err(26914):    at java.lang.Integer.parseInt(Integer.java:359)
  08-10 16:10:34.127: W/System.err(26914):    at java.lang.Integer.parseInt(Integer.java:332)
  08-10 16:10:34.127: W/System.err(26914):    at java.util.Calendar.getHwFirstDayOfWeek(Calendar.java:807)
  08-10 16:10:34.127: W/System.err(26914):    at java.util.Calendar.&lt;init&gt;(Calendar.java:745)
  08-10 16:10:34.127: W/System.err(26914):    at java.util.GregorianCalendar.&lt;init&gt;(GregorianCalendar.java:338)
  08-10 16:10:34.127: W/System.err(26914):    at java.util.GregorianCalendar.&lt;init&gt;(GregorianCalendar.java:325)
  08-10 16:10:34.127: W/System.err(26914):    at org.apache.harmony.security.asn1.ASN1Time.getDecodedObject(ASN1Time.java:44)
  08-10 16:10:34.127: W/System.err(26914):    at org.apache.harmony.security.asn1.ASN1UTCTime.decode(ASN1UTCTime.java:82)
  08-10 16:10:34.127: W/System.err(26914):    at org.apache.harmony.security.asn1.ASN1Choice.decode(ASN1Choice.java:308)
  08-10 16:10:34.127: W/System.err(26914):    at org.apache.harmony.security.asn1.BerInputStream.readSequence(BerInputStream.java:554)
  08-10 16:10:34.127: W/System.err(26914):    at org.apache.harmony.security.asn1.DerInputStream.readSequence(DerInputStream.java:105)
  08-10 16:10:34.127: W/System.err(26914):    at org.apache.harmony.security.asn1.ASN1Sequence.decode(ASN1Sequence.java:40)
  08-10 16:10:34.127: W/System.err(26914):    at org.apache.harmony.security.asn1.BerInputStream.readSequence(BerInputStream.java:554)
  08-10 16:10:34.127: W/System.err(26914):    at org.apache.harmony.security.asn1.DerInputStream.readSequence(DerInputStream.java:105)
  08-10 16:10:34.127: W/System.err(26914):    at org.apache.harmony.security.asn1.ASN1Sequence.decode(ASN1Sequence.java:40)
  08-10 16:10:34.127: W/System.err(26914):    at org.apache.harmony.security.asn1.BerInputStream.readSequence(BerInputStream.java:554)
  08-10 16:10:34.127: W/System.err(26914):    at org.apache.harmony.security.asn1.DerInputStream.readSequence(DerInputStream.java:105)
  08-10 16:10:34.127: W/System.err(26914):    at org.apache.harmony.security.asn1.ASN1Sequence.decode(ASN1Sequence.java:40)
  08-10 16:10:34.127: W/System.err(26914):    at org.apache.harmony.security.asn1.ASN1Type.decode(ASN1Type.java:91)
  08-10 16:10:34.127: W/System.err(26914):    at org.apache.harmony.security.provider.cert.X509CertImpl.&lt;init&gt;(X509CertImpl.java:102)
  08-10 16:10:34.127: W/System.err(26914):    at org.apache.harmony.security.provider.cert.X509CertFactoryImpl.getCertificate(X509CertFactoryImpl.java:656)
  08-10 16:10:34.127: W/System.err(26914):    at org.apache.harmony.security.provider.cert.X509CertFactoryImpl.engineGenerateCertificate(X509CertFactoryImpl.java:109)
  08-10 16:10:34.127: W/System.err(26914):    at java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:195)
  08-10 16:10:34.135: W/System.err(26914):    at com.google.android.gms.common.GooglePlayServicesUtil.a(Unknown Source)
  08-10 16:10:34.135: W/System.err(26914):    at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
  08-10 16:10:34.135: W/System.err(26914):    at com.google.android.gms.internal.p.connect(Unknown Source)
  08-10 16:10:34.135: W/System.err(26914):    at com.google.android.gms.location.LocationClient.connect(Unknown Source)
  08-10 16:10:34.135: W/System.err(26914):    at com.example.android.location.MainActivity.onStart(MainActivity.java:197)
  08-10 16:10:34.135: W/System.err(26914):    at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1133)
  08-10 16:10:34.135: W/System.err(26914):    at android.app.Activity.performStart(Activity.java:4475)
  08-10 16:10:34.135: W/System.err(26914):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1929)
  08-10 16:10:34.135: W/System.err(26914):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
  08-10 16:10:34.135: W/System.err(26914):    at android.app.ActivityThread.access$600(ActivityThread.java:123)
  08-10 16:10:34.135: W/System.err(26914):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
  08-10 16:10:34.135: W/System.err(26914):    at android.os.Handler.dispatchMessage(Handler.java:99)
  08-10 16:10:34.135: W/System.err(26914):    at android.os.Looper.loop(Looper.java:137)
  08-10 16:10:34.135: W/System.err(26914):    at android.app.ActivityThread.main(ActivityThread.java:4424)
  08-10 16:10:34.135: W/System.err(26914):    at java.lang.reflect.Method.invokeNative(Native Method)
  08-10 16:10:34.135: W/System.err(26914):    at java.lang.reflect.Method.invoke(Method.java:511)
  08-10 16:10:34.135: W/System.err(26914):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
  08-10 16:10:34.135: W/System.err(26914):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
  08-10 16:10:34.135: W/System.err(26914):    at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>the code is here:</p>
  
  <pre><code>public class MainActivity extends FragmentActivity implements
      LocationListener,
      GooglePlayServicesClient.ConnectionCallbacks,
      GooglePlayServicesClient.OnConnectionFailedListener {
  
  // A request to connect to Location Services
  private LocationRequest mLocationRequest;
  
  // Stores the current instantiation of the location client in this object
  private LocationClient mLocationClient;
  ......
  }
  ......
  public void onStart() {
  
      Log.i(TAG, "onStart of MainActivity");
      super.onStart();
  
      /*
       * Connect the client. Don't re-start any requests here;
       * instead, wait for onResume()
       */
      Log.i(TAG, "connect() of LocationClient begin");
      mLocationClient.connect();
      Log.i(TAG, "connect() of LocationClient finish");
  
  }
  </code></pre>
  
  <p>The exception is because the sentence:</p>
  
  <pre><code>mLocationClient.connect();
  </code></pre>
  
  <p>there is also another project when I try to new a MimeMessage, it throw a exactly the same exception: NumberFormatException:</p>
  
  <pre><code>MimeMessage message = new MimeMessage(session);
  </code></pre>
  
  <p>In fact, In my projects, there are many scenarios where throw out this kinds of exception even I didn't operate a number/time related variable.
  This guy has same problem with me.
  <a href="https://stackoverflow.com/questions/16936086/android-error-in-java-inputstreamreader-only-with-huawei-phone">Android error in java InputStreamReader only with Huawei phone</a></p>
  
  <p>I struggled with this exception for many days. I don't know why. Hope some android experts can help me. Thanks to you all.
  My mobile is Huawei Ascend D1 dual.</p>