BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 06-27-2007, 01:11 AM   #1 (permalink)
New Member
 
Join Date: Jun 2007
Model: 8800
PIN: N/A
Carrier: Vodafone
Posts: 11
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default 8800 GPS frequently invalid

Please Login to Remove!

Hi,

I've been playing around with the 8800 for a couple of days now and am having issues with getting a valid GPS position. Currently, I just made a LocationListener class which I setup with my LocationProvider object to run every 60 seconds. The psuedocode for what happens in the locationUpdated function of my class is as follows (based on gpsdemo):

Code:
////////////////////
// initialised at start up
///////////////////
LocationProvider _locationProvider = LocationProvider.getInstance(null);
_locationProvider.setLocationListener(new LocationListenerImpl(), 60, 1, 1);

...

// this is the class
private class LocationListenerImpl implements LocationListener
{
   public void locationUpdated(LocationProvider provider, Location location)
   {
      if(location.isValid())
      {
         // get lat, lon, etc.
         // Make data into string
      }
      else
      {
         // Make own data string to indicate no fix was received
      }
      // Send data string to HTTP site as a GET request
   }
}
Everything there works, so I haven't got caught up on detail. The problem is that the location.isValid() returns false about 50% of the time. I've got the BB outside on the dash of my car now, screen facing the sky, and I'm getting real data about 25% of the time. Changing the frequency locationUpdate runs to 120 seconds didn't fix anything.

Does anyone have any idea why I can never get a fix? Even if I stand in an open area holding the device in my hand? Should I kill the LocationListener instance each time I am done and use something else for my timing? Should I use the Criteria class instead?

Any help would be greatly appreciated.

Dan.

Last edited by kuntushi : 06-27-2007 at 01:16 AM. Reason: Changed code
Offline  
Old 06-27-2007, 10:35 PM   #2 (permalink)
New Member
 
Join Date: Jun 2007
Model: 8800
PIN: N/A
Carrier: Vodafone
Posts: 11
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Problem solved people, stop the desperate search for the answer.

Using a timeout value (3rd value in setLocationListener) of 1 second wasn't agreeing with the system. If anyone has issues in the future, increase the timeout length. 10 seconds worked fine for me.

It's strange they use this value in a BlackBerry demo app (gpsdemo).
Offline  
Old 07-03-2007, 02:09 PM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: May 2007
Model: 8800
PIN: N/A
Carrier: Rogers
Posts: 17
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

if the gps chip is cold (i.e. not connected to satellites) it can take two or three minutes to acquire a fix. you're interval value+timeout value doesn't accomodate this situation.

one trick you can do to keep the gps chip hot is to drop the interval value to something under 10 seconds. if the gps chip is inactive for 9 seconds, it will disconnect from the satellites. well, at least that was the case for the older 7520s.

your locationprovider implementation will basically ask for cold fixes every minute. either lower the interval to keep the gps chip hot or raise it to allow for cold fixes.
Offline  
Old 07-03-2007, 08:27 PM   #4 (permalink)
New Member
 
Join Date: Jun 2007
Model: 8800
PIN: N/A
Carrier: Vodafone
Posts: 11
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks mate.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.