10-22-2009 12:25 AM
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..
10-22-2009 12:38 AM
Yeah.. I am testing it outside also, but what do you mean by "have gotten a fix before"?
10-22-2009 12:42 AM
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....
10-22-2009 12:44 AM
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.
10-22-2009 01:08 AM - edited 10-22-2009 07:18 AM
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 :
10-22-2009 01:24 AM
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 ....
10-22-2009 01:30 AM
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.
10-22-2009 03:17 AM
I am eagerly waiting for anybody's response on the post. Anybody Simon, Peter, BBDeveloper... Plz plz pay attention to this post also.
10-22-2009 05:16 AM
Anybody, Kindly pay attention to this post. I really need an urgent help for this.