BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 06-27-2011, 01:09 PM   #1
xmncxzvt
Thumbs Must Hurt
 
Join Date: Mar 2011
Model: 8900
PIN: N/A
Carrier: Torch
Posts: 59
Default GPS always give latitude & longitude zero

Please Login to Remove!

Hello,

I am getting latitude & longitude through GPS in blackberry but it always give me latitude: 0.0 and longitude 0.0

for testing i get values in paint method & invalidate it then it showed latitude: 0.0 and longitude 0.0 for first 3 times while invalidating ...after long time it showed correct values

Any one knows what is the correct solution to get correct values from GPS??
Offline  
Old 06-27-2011, 01:37 PM   #2
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default Re: GPS always give latitude & longitude zero

What GPS method are you using? If you are requesting GPOS fix using autonomous mode, it can take as long as 3 minutes to get the first fix. Even with network assist, it does not happen instantly.

Maybe you are checking to early, before the fix is completed?
Offline  
Old 06-28-2011, 02:41 AM   #3
xmncxzvt
Thumbs Must Hurt
 
Join Date: Mar 2011
Model: 8900
PIN: N/A
Carrier: Torch
Posts: 59
Default Re: GPS always give latitude & longitude zero

I am using this autonomous mode with following criteria . I have set interval of 5 minutes so it obtain first location after 5 mins.
I have make separate thread which sleeps for 5 mins (inorder to get first location after first fix) But even after that when i get latitude & longitude it shows 0.0

Criteria c = new Criteria();

c.setHorizontalAccuracy(50);
c.setVerticalAccuracy(50);
c.setCostAllowed(true);
c.setPreferredPowerConsumption(Criteria.POWER_USAG E_MEDIUM);

try {
lp = LocationProvider.getInstance(c);
} catch (LocationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
lp.setLocationListener(new MyLocationListener(),300, 10,30);
Offline  
Old 06-28-2011, 06:51 AM   #4
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Default Re: GPS always give latitude & longitude zero

Quote:
Originally Posted by xmncxzvt View Post
I am using this autonomous mode with following criteria . I have set interval of 5 minutes so it obtain first location after 5 mins.
I have make separate thread which sleeps for 5 mins (inorder to get first location after first fix) But even after that when i get latitude & longitude it shows 0.0

Criteria c = new Criteria();

c.setHorizontalAccuracy(50);
c.setVerticalAccuracy(50);
c.setCostAllowed(true);
c.setPreferredPowerConsumption(Criteria.POWER_USAG E_MEDIUM);

try {
lp = LocationProvider.getInstance(c);
} catch (LocationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
lp.setLocationListener(new MyLocationListener(),300, 10,30);
Have a look at this sticky thread on posting code. It makes reading your code much easier:
Code:
Criteria c = new Criteria();
				
		c.setHorizontalAccuracy(50);
		c.setVerticalAccuracy(50);
		c.setCostAllowed(true);
		c.setPreferredPowerConsumption(Criteria.POWER_USAGE_MEDIUM);

		try {
			lp = LocationProvider.getInstance(c);
		} catch (LocationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		lp.setLocationListener(new MyLocationListener(),300, 10,30);
The quality of an autonomous fix is going to depend on the quality of the signal you receive. First, try not setting accuracy requirements. Also, if you are using a location listener, you don't need to have a thread sleep for 5 minutes, the listener will only be called at the interval you select. In this case 5 minutes.

You may also want to read the documentation for setLocationListener, and pay particular attention to the paragraphs on timeout and maxAge. I don't know what your requirements are, but having an interval of 300 but a timeout of 10 and max age of 30 don't make much sense in most cases. What you're saying is give me a position every 300 seconds, but has to have an hdop and vdop of bettern than 50 meters, can't be more than 30 seconds old (at the time it is delivered), and only wait for 10 secods for a new position if one isn't available. I suspect the locations you are getting also have the valid flage set to false.
__________________
My other Blackberry is a PlayBook.
Offline  
Closed Thread



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads for: GPS always give latitude & longitude zero
Thread Thread Starter Forum Replies Last Post
help with the SyncLBS: latitude and longitude hollyhogan BES Admin Corner 6 07-22-2008 02:09 PM
Blackberry 8130 Built-In GPS: Get more functionality SHAPE General 8100 Series Discussion - Pearl 4 12-29-2007 10:02 AM


Siemens 6AU14 35-0AA00-0AA1 6AU1435-0AA00-0AA1 SIMOTION DRIVE-BASED CONTROL New  picture

Siemens 6AU14 35-0AA00-0AA1 6AU1435-0AA00-0AA1 SIMOTION DRIVE-BASED CONTROL New

$3988.00



6FC5610-0BA10-0AA1 SIEMENS LCD Screen Display 1PCS picture

6FC5610-0BA10-0AA1 SIEMENS LCD Screen Display 1PCS

$2998.00



6AV6643-0BA01-1AX0 Siemens SMART PLC Module 6AV6643-0BA01-1AX0 New In Box picture

6AV6643-0BA01-1AX0 Siemens SMART PLC Module 6AV6643-0BA01-1AX0 New In Box

$840.75



New In Box Siemens 6SL3130-6AE21-0AB1 SINAMICS S120 Module 6SL3 130-6AE21-0AB1 picture

New In Box Siemens 6SL3130-6AE21-0AB1 SINAMICS S120 Module 6SL3 130-6AE21-0AB1

$950.00



LOT OF 5 SIEMENS Q120DFN 20A DUAL AFCI/GFCI PLUG ON NEUTRAL BREAKER BRAND NEW picture

LOT OF 5 SIEMENS Q120DFN 20A DUAL AFCI/GFCI PLUG ON NEUTRAL BREAKER BRAND NEW

$199.00



LOT OF 10 SIEMENS Q120DFN 20A DUAL AFCI/GFCI PLUG ON NEUTRAL BREAKER BRAND NEW picture

LOT OF 10 SIEMENS Q120DFN 20A DUAL AFCI/GFCI PLUG ON NEUTRAL BREAKER BRAND NEW

$419.99







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