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

Web and WebWorks Development

Reply
Highlighted
Contributor
Posts: 34
Registered: ‎08-01-2012
My Device: Playbook
My Carrier: None
Accepted Solution

Run app in background and receive geoLocation updates

Is it possible to run an app in the background (e.g. while doing other things like using the browser, mail, etc.) and still recieve HTML5 geolocation updates?

Developer
Developer
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Run app in background and receive geoLocation updates


zedsaid wrote:

Is it possible to run an app in the background (e.g. while doing other things like using the browser, mail, etc.) and still recieve HTML5 geolocation updates?


Depends on the BB OS and device you are looking for. For me, running in Background means it is still open but not in foreground and you/the user may work within another app. In this case the geolocation updates may be thrown to your app in background as well using the navigator.geolocation.watchPostition handler for HTML5 Geolocation. As of what I know, BB OS 5+ for SmartPhones also supports the rim:background element so this might also be helpful to research, have a closer look to this great article from superfly_fr: http://thebbthing.wordpress.com/2012/06/25/quick-webworks-lesson-how-to-have-your-app-running-in-the...


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Contributor
Posts: 34
Registered: ‎08-01-2012
My Device: Playbook
My Carrier: None

Re: Run app in background and receive geoLocation updates

Sorry I should have mentioned this is for the playbook. I am using watchPosition.

So how do I keep my app running just not in the foreground? Or does that happen automatically?
Developer
Developer
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Run app in background and receive geoLocation updates

If you bring your app to the "background" and do not close, the watchPosition should go on delivering data within your app. App in background means you open up the app and swipe from bottom to somehow minimize it, eg. to open another app or something like this. As long as it stays up in the list of open apps it should "watch the position".


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Contributor
Posts: 34
Registered: ‎08-01-2012
My Device: Playbook
My Carrier: None

Re: Run app in background and receive geoLocation updates

It is strange how little information I can find about the rim:background element.  It seems only a few people are talking about it.  Confused at how it works and if I even need it here.  Are there any examples?

Developer
Developer
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Run app in background and receive geoLocation updates

As I wrote before the rim:background element is only available for BB SmartPhone OS at this times, not for PlayBook or BB10 at this time. So for a PlayBook app this won't be helpful.


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Contributor
Posts: 34
Registered: ‎08-01-2012
My Device: Playbook
My Carrier: None

Re: Run app in background and receive geoLocation updates

Sorry, didn't realize you said that.