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

Java Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Unable to capture GPS data in background application

Hi,

 

I have a background application in which I am trying to capture GPS data: latitude & longitude. This is working fine in simulator, but not working fine in real device. For, this I created a GPS class by which I am trying to retreive the data.

 

When, I used the same class in an UIApplication. It is showing the data on Screen of the respective UiApplication, but, is returning no gps data in the background application.

 

Am I wrong in fetching the gps data from a background thread? Is it like this that we can do the aforesaid task in a forground application only..? Plz. help me in resolving ths problem. As, I am trying my hands upon this since last so many days..

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 562
Registered: ‎09-30-2009
My Device: Not Specified

Re: Unable to capture GPS data in background application

Are you testing on your device in the correct conditions to get a GPS fix, ie., you are outside, have gotten a fix before, etc.

Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: Unable to capture GPS data in background application

Yeah.. I am testing it outside also, but what do you mean by "have gotten a fix before"?

 

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 220
Registered: ‎09-09-2008
My Device: Bold 9780
My Carrier: Telstra AU

Re: Unable to capture GPS data in background application

well the question is if u run the location thread in a background thread how do u know when or if it has a fix.....

 

so to make sure if your application has a fix use another application wait till it has a fix and then start ur application then ur app should have gps in a few seconds this way u know for use if its ur application or if it is just the case you not having a gps signal... as i assume u know how gps works and how long it takes to get a signal.....

 

i have written loads of applications and always run them in the ui thread as i never had to move them into a background task ..... but i would love to know if there are issues....

-----------

Follow me on twitter: twitter.com/paul.haenel

If your issue is resolved, please mark this thread as solved.

Set the "Solution" mark on the post which contains the answer to your question.
Developer
Posts: 562
Registered: ‎09-30-2009
My Device: Not Specified

Re: Unable to capture GPS data in background application

If a GPS receiver is cold booted, and assistance is not use, the time to first fix is going to take in the order of minutes, not seconds. So, try to wait and get a fix first, and then test your application.

Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: Unable to capture GPS data in background application

[ Edited ]

Thanks Pauland ydaraishy for ur quick response,

 

Actually I am  using a timer in my application, which runs the GPS class (this implements LocationListener) run after a fixed interval and sleeps for sometime, and again runs the listener. The code I am using is :

 

 

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 220
Registered: ‎09-09-2008
My Device: Bold 9780
My Carrier: Telstra AU

Re: Unable to capture GPS data in background application

ok sure that makes sense ... so are you sure that you have GPS signal ? as the code looks fine to me .... it just never gets to the point where it has GPS signal ... which i think it means that your device hasnt found GPS yet .. as it takes a while to locate you.... so can you ensure u have gps first before running ur application .... and let me know if thats the case ....

-----------

Follow me on twitter: twitter.com/paul.haenel

If your issue is resolved, please mark this thread as solved.

Set the "Solution" mark on the post which contains the answer to your question.
Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: Unable to capture GPS data in background application

Yeah I am able to access google maps from my device and also as I said earlier, UIApplication with the above GPS class is also running fine.

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: Unable to capture GPS data in background application

I am eagerly waiting for anybody's response on the post. Anybody Simon, Peter, BBDeveloper... Plz plz pay attention to this post also.

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: Unable to capture GPS data in background application

Anybody, Kindly pay attention to this post. I really need an urgent help for this.Smiley Sad

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro