Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Runtime Development

Reply
Super Contributor
Meghasanghvi
Posts: 306
Registered: ‎08-10-2010
My Device: Not Specified
Accepted Solution

Different GPS error when location service is off

Hi,

 

I port my android application to BB10 it is location vased services. So when i disable the location service in android it gives me error message like this : "The Phone's GPS must be enabled" and same way i disable the location service in BB10 it gives me error message like : " Timeout obtaining the GPS location"

 

So what is issue in this?

 

 

Please use plain text.
Regular Contributor
Fraggle222
Posts: 84
Registered: ‎01-31-2013
My Device: Simulator !!!
My Carrier: 8608800458

Re: Different GPS error when location service is off

Can you be more specific as to what method is getting called? I assume it's one of the LocationListener methods. And is the only difference the text of what is passed to that method?


public abstract void onStatusChanged(java.lang.String arg0, int arg1, android.os.Bundle arg2);


public abstract void onProviderEnabled(java.lang.String arg0);


public abstract void onProviderDisabled(java.lang.String arg0);
Please use plain text.
BlackBerry Development Advisor
bbenninger
Posts: 130
Registered: ‎04-19-2013
My Device: BlackBerry Z10

Re: Different GPS error when location service is off

[ Edited ]

The issue is that the Android location provider enabled / disabled does not match the OS Settings.  So if it's enabled in Android, but disabled in the OS, then Android assumes it should be able to access this data.  It cannot.

 

It is a bug / oversight that toggling the OS Setting doesn't toggle the Android setting.

 

Edit:  The development team knows of this issue and a solution is being worked on for a future release.

Please use plain text.
Regular Contributor
Fraggle222
Posts: 84
Registered: ‎01-31-2013
My Device: Simulator !!!
My Carrier: 8608800458

Re: Different GPS error when location service is off

Ok, got it. Seems like a definite bug. 

 

Log it in the JIRA system.

 

Also, can you confirm for me the following (I've opened a thread on this):

 

If application is getting GPS updates and user clicks power button to turn off screen, then Location updates will stop.

 

I'm testing on an actual Z10 device, not sure about simulator.

 

Location updates resume when Activity is visible again.

 

Note too that Activity onStop() is called which is also a bug since in all other Android devices onStop does not get called when user turns off screen (only onPause is called).

 

Thanks.

 

Please use plain text.
BlackBerry Development Advisor
bbenninger
Posts: 130
Registered: ‎04-19-2013
My Device: BlackBerry Z10

Re: Different GPS error when location service is off

onStop might get called eventually on stock Android after some time when the screen goes off.  Perhaps if there's a keyguard or something.  Either way I always anticipate onStop as possible if the screen is off.

Please use plain text.