Closed GoogleCodeExporter closed 9 years ago
Assigning to Chen for evaluation.
Original comment by shai.almog
on 31 Dec 2012 at 10:22
can you provide a stack trace from the ddms?
Original comment by cf27...@gmail.com
on 1 Jan 2013 at 7:56
I have tested it on Android emulator and it crash. I don't really know how can
I get those traces.
Original comment by rashydos
on 1 Jan 2013 at 10:31
under the Android emulator directory run the ddms
on my machine it is located here:
C:\Program Files (x86)\Android\android-sdk\tools\ddms.bat
once you run the emulator (select the emulator node on the top left corner in
the ddms)you will see the output and exception to the ddms log.
Original comment by cf27...@gmail.com
on 2 Jan 2013 at 10:18
Here you are... Thanks for the info.
The bestProvider is null :)
=======================================================================
01-02 10:23:49.081: I/System.out(811): bestProvider null
01-02 10:23:49.081: D/AndroidRuntime(811): Shutting down VM
01-02 10:23:49.081: W/dalvikvm(811): threadid=1: thread exiting with uncaught
exception (group=0x40a13300)
01-02 10:23:49.091: E/AndroidRuntime(811): FATAL EXCEPTION: main
01-02 10:23:49.091: E/AndroidRuntime(811): java.lang.IllegalArgumentException:
provider==null
01-02 10:23:49.091: E/AndroidRuntime(811): at
android.location.LocationManager.requestLocationUpdates(LocationManager.java:477
)
01-02 10:23:49.091: E/AndroidRuntime(811): at
com.codename1.impl.android.d$1.run(Unknown Source)
01-02 10:23:49.091: E/AndroidRuntime(811): at
android.os.Handler.handleCallback(Handler.java:615)
01-02 10:23:49.091: E/AndroidRuntime(811): at
android.os.Handler.dispatchMessage(Handler.java:92)
01-02 10:23:49.091: E/AndroidRuntime(811): at
android.os.Looper.loop(Looper.java:137)
01-02 10:23:49.091: E/AndroidRuntime(811): at
android.app.ActivityThread.main(ActivityThread.java:4745)
01-02 10:23:49.091: E/AndroidRuntime(811): at
java.lang.reflect.Method.invokeNative(Native Method)
01-02 10:23:49.091: E/AndroidRuntime(811): at
java.lang.reflect.Method.invoke(Method.java:511)
01-02 10:23:49.091: E/AndroidRuntime(811): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
01-02 10:23:49.091: E/AndroidRuntime(811): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
01-02 10:23:49.091: E/AndroidRuntime(811): at
dalvik.system.NativeStart.main(Native Method)
01-02 10:23:49.121: I/System.out(811): showKeyboard false
01-02 10:23:49.131: W/ActivityManager(151): Force finishing activity
ma.gpsweb/.GPSWebMarocStub
the app is on http://m.gpsweb.ma
Original comment by rashydos
on 2 Jan 2013 at 10:28
I think the problem is on bindListener() that didn't check provider before
requesting location update
public void bindListener() {
Handler mHandler = new Handler(Looper.getMainLooper());
mHandler.post(new Runnable() {
public void run() {
locationManager.requestLocationUpdates(bestProvider, 0, 0, AndroidLocationManager.this);
}
});
}
Original comment by rashydos
on 2 Jan 2013 at 10:38
the issue occurs because the device is not able the get a location from the gps
and the network.
usually if the gps is off we try to get it from the network, but it is possible
the network is also not ready or enables, anyway I'll to patch this, in any
case it should not crash.
Original comment by cf27...@gmail.com
on 2 Jan 2013 at 10:49
Also LocationManager.getLocationManager() should return null if provider is
null
or
getStatus() should return out of service in this case.
Thanks.
Original comment by rashydos
on 2 Jan 2013 at 10:50
make sense, I will return an out of service in this case.
Original comment by cf27...@gmail.com
on 2 Jan 2013 at 11:19
Thanks Chen
Original comment by rashydos
on 2 Jan 2013 at 11:23
fixed, will be available in the next server update, thanks
Original comment by cf27...@gmail.com
on 2 Jan 2013 at 12:11
I think this bug should be reopened.
I have the same issue on j2me platform.
Mobile phone: Nokia 5530 Express Music
My application successfully runs in emulator but when it runs in the phone it
fails.
Method LocationManager.getStatus() returns constant TEMPORARILY_UNAVAILABLE in
the emulator as well as in the phone. Weird but location listener in the
application receives location events even when LocationManager has this status
(TEMPORARILY_UNAVAILABLE) when the application runs in the emulator. In the
real phone the application fails with NullPointerException just after binding
listener. I have no stack trace but I traced the error and found out that NPE
is thrown from Codenameone framework.
Original comment by dmitry.t...@gmail.com
on 26 Nov 2013 at 3:53
Its unrelated. I suggest asking on the forum and including your code.
Original comment by shai.almog
on 26 Nov 2013 at 7:12
Original issue reported on code.google.com by
rashydos
on 31 Dec 2012 at 9:37