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
Developer
Posts: 66
Registered: ‎09-04-2008
My Device: Z10

"run_when_backgrounded" isn´t supporting GPS?

Hi BB Devs,

 

during some tests on a real Z10 i figured out, that it seems getting (GPS) location is impossible when the Device turns into "standby" (pushing the Button on top of Z10), and also when the app is running in background/minimized (swipe on Z10 from bottom->up and minimize app).

All other functions are working in the background or standby - but not the getting the GPS location.

 

In the config.xml i set the "run_when_backgrounded" and of corse the "access_location_services" permits.

 

Can anyone confirm this issue/feature?

 

I found this Post here in the Forum:

http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Running-a-webworks-app-with-devi...

 

So my hope is that something was changed in the last month, or will change very soon?

Any - hopefully positive - news for me?

 

Thanks a lot

Lars.

 

 

---

My Twitter:
http://twitter.com/lgentz
Developer
Posts: 66
Registered: ‎09-04-2008
My Device: Z10

Re: "run_when_backgrounded" isn´t supporting GPS?

I know cascades != webworks but i found this in the cascades documentation:

 

Getting updates in the background

If you want your app to continue to get location fixes while your app is in the background or minimized, you must set the canRunInBackground property to true. For example, this could be used by a fleet tracking application that needs to update the dispatch office with the current location of the vehicle while the app is minimized.

 

So this means to me that it must be generally posible to receive a GPS location - even when the App is in background / minimized.

 

Perhaps anyone has an idea or tip for me to get this working in webworks.

Would be great!!! 

 

---

My Twitter:
http://twitter.com/lgentz
Developer
Posts: 213
Registered: ‎10-02-2010
My Device: Z10 and Z30
My Carrier: Play and Plus

Re: "run_when_backgrounded" isn´t supporting GPS?

Try using this event - blackberry.app.windowstatechanged

 

https://developer.blackberry.com/html5/apis/blackberry.app.html

 

 

Developer
Posts: 66
Registered: ‎09-04-2008
My Device: Z10

Re: "run_when_backgrounded" isn´t supporting GPS?

Hi ddluk,

 

thanks for your post!

I tried this, and build this eventListener in my app.

 

Everytime when the state is changed i stoped my active intervall and started a new one. First an intervall without location service ---> works (also when app was invisible or thumbnail.

 

The same with location service --> doesn´t work.

The function doesn´t run into the success callback of the navigator.geolocation.getCurrentPosition code.

 

If i set a timeout to 30000ms via options, my app give´s me an JavaScript Alert after around 30seconds in invisible or thumbnail state.

"An unexpectet error [3]: Timeout expired"

 

So it seems the getCurrentPosition gets no answer from the device when windowState is invisible or thumbnail?

Right?

---

My Twitter:
http://twitter.com/lgentz
Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: "run_when_backgrounded" isn´t supporting GPS?

Based on your testing, that sounds very much like a bug to me. Have you created a JIRA issue yet? If not, can you please do so? Also, can you email me the JIRA URL once created (eoros@blackberry.com) and I will jump in and escalate it. Thanks!

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Developer
Posts: 66
Registered: ‎09-04-2008
My Device: Z10

Re: "run_when_backgrounded" isn´t supporting GPS?

Hi Erik,

 

i already created an issue at github:

https://github.com/blackberry/BB10-WebWorks-Framework/issues/640

 

should i open an issue at JIRA too? 

If yes - which project / version should i choose.

I checked the JIRA projects and just found:

 

bb10 -> native sdk, adobe aire - no webworks

web apis -> only up to os version 7

tools -> webworks sdk v2.2 for playbook

 

i think the right project would be

tools -> bb10 webworks sdk v1.0.x 

but i couldn´t find any matching...?

 

Thanks a lot for a short answer

Lars.

---

My Twitter:
http://twitter.com/lgentz
Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: "run_when_backgrounded" isn´t supporting GPS?

Ah, if you've created in Github then that should do; the development teams monitor that directly as well and should jump in with some feedback there. I'll keep an eye on it for their response as well.


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.