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™ Development

Reply
Retired
Posts: 140
Registered: ‎04-19-2013
My Device: BlackBerry Z10

Re: How to get GPS location on application ported from android to BB10?

If you hold a wake lock in your app the runtime will detect it and will let your app receive location updates when the screen is off.

New Contributor
Posts: 4
Registered: ‎08-18-2013
My Device: Q10 SQN100-1 10.2.0.1047
My Carrier: Bell Mobility

Re: How to get GPS location on application ported from android to BB10?

Great it worked, used this :

 

        PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
        mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE, "My Tag");
        mWakeLock.acquire();

 

Next step will be to run the app without any visible frame and at the startup!

Highlighted
Retired
Posts: 140
Registered: ‎04-19-2013
My Device: BlackBerry Z10

Re: How to get GPS location on application ported from android to BB10?

It goes without saying that you shouldn't hold this indefinitely; if android detects that as well, it'll shut you down (aka standard wake lock stuff).

New Contributor
Posts: 4
Registered: ‎07-31-2013
My Device: Q10
My Carrier: Airtel

Re: How to get GPS location on application ported from android to BB10?

i tried it not a solution. its still working for me atleast.