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
Developer
brsengar
Posts: 70
Registered: ‎04-20-2012
My Carrier: Vodafone

Android application ported on BB10 pauses when device is locked

Hi,

 

I am facing a situation where my ported Android application pauses when BB10 device is locked. My application has activity and couple of background services. Please note that when device was locked, my application was in foreground. I couldnt find this behaviour in documentation. Any help would be appreciated.

 

Thanks

Brsengar

Please use plain text.
BlackBerry Development Advisor
jjasmann
Posts: 237
Registered: ‎01-08-2013
My Carrier: Bell

Re: Android application ported on BB10 pauses when device is locked

Hey Brsengar,

 

Could you clarify what you mean when you say that your application pauses when the device is locked?

Note*: Android background services are not supported.

 

Unsupported Software Features: https://developer.blackberry.com/android/apisupport/unsupportedapi_blackberry10_software_features.ht...

 

    Justin

Justin Jasmann | Android Application Development Consultant
Developer Relations
developer.blackberry.com
Please use plain text.
BlackBerry Development Advisor
bbenninger
Posts: 130
Registered: ‎04-19-2013

Re: Android application ported on BB10 pauses when device is locked

Not only does Activity onPause get called, but onStop gets called as well.

 

Use a Service.  Anything you want to run "in the background" shouldn't be tied to an Activity lifecycle.

Please use plain text.
BlackBerry Development Advisor
jjasmann
Posts: 237
Registered: ‎01-08-2013
My Carrier: Bell

Re: Android application ported on BB10 pauses when device is locked

bbenninger,

 

As tested on a Galaxy S3, onPause() does get called when the device goes into locking state and can have onStop() called if the system requires resources.

 

BB10 behaves much the same way. onPause() gets called when the device enters a locking state and eventually calls onStop() to reclaim resources.

 

    Justin

Justin Jasmann | Android Application Development Consultant
Developer Relations
developer.blackberry.com
Please use plain text.