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
Developer
Posts: 70
Registered: ‎04-20-2012
My Device: BB 9105
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

Retired
Posts: 264
Registered: ‎01-08-2013
My Device: BlackBerry 10 Dev Alpha B
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
Retired
Posts: 140
Registered: ‎04-19-2013
My Device: BlackBerry Z10

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.

Highlighted
Retired
Posts: 264
Registered: ‎01-08-2013
My Device: BlackBerry 10 Dev Alpha B
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