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

Reply
Contributor
ferry_new2004
Posts: 16
Registered: ‎01-18-2011
My Device: 9800
My Carrier: AT&T

GPS Autonomous unable to get current location

hello guys, I have just tried Blackberry GPS API  to get current location using this criteria (depend on GPS only).

 

...
myCriteria.setCostAllowed(false);
myCriteria.setPreferredPowerConsumption(Criteria.POWER_USAGE_MEDIUM);
myCriteria.setPreferredResponseTime(16);
myCriteria.setHorizontalAccuracy(100);

 

LocationProvider provider = LocationProvider.getInstance(myCriteria);
Location location = provider.getLocation(180);

..

 

I run the code into blackberry OS 6 (Torch) with GPS enabled on the option menu but got time out error.

I have made sure Option -> Device ->  Location Settings -> Location Services on.

I also tested Google Map application installed, Google Map application can get current location.

 

I also have tested if I change the time out value

Location location = provider.getLocation(-1);

The program running forever without getting the current latitude location.

 

 

If  I change the criteria to be :

 Criteria csCriteria = new Criteria();
 csCriteria.setHorizontalAccuracy(Criteria.NO_REQUIREMENT);
 csCriteria.setVerticalAccuracy(Criteria.NO_REQUIREMENT);
 csCriteria.setCostAllowed(true);
 csCriteria.setPreferredPowerConsumption(Criteria.POWER_USAGE_LOW);

 

It can return the current location but this is not what I am looking for ( I want to get current location based on GPS only).

 

 

I read previous postings in forum and got no solution for this.

Does any know know what's wrong with this ?

 

Thank you very much.

 

 

Regards,

Ferry

 

 



 

 

 

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: GPS Autonomous unable to get current location

We need to clarify one thing. 

 

You use Google Maps to demonstrate that it should be possible to find your GPS location.  But I would be confident that Google is not using your GPS to find the location, especially if it comes back quickly.  It will probably be using CellSite and WiFi.  Why do you think that Google Maps finding your location is a demonstration that GPS should work?

 

With respect to your problem, I suspect the problem here is that in fact your device can't find a true GPS location.  To confirm this, go into Options --> Device --> Location Settings.  Make sure the GPS Data source is "Device GPS" and use the menu to refresh Location.  I'm betting it does not find a location.  If it does find a location and the number of satellites is 0, then this is a Cell Site location not GPS. 

Please use plain text.
Contributor
ferry_new2004
Posts: 16
Registered: ‎01-18-2011
My Device: 9800
My Carrier: AT&T

Re: GPS Autonomous unable to get current location

Hi Peter, you are right.

 

>To confirm this, go into Options --> Device --> Location Settings.  Make sure the GPS Data source is "Device GPS" >and use the menu to refresh Location.  I'm betting it does not find a location.  If it does find a location and the number >of satellites is 0, then this is a Cell Site location not GPS.

 

The number of satelites is 0. I have just known about it.

 

I assume Google Map application uses GPS not cellsite because it can display route to  any place. According to what I read, Cellsite information cannot display route to any place.

If Google Map application uses cellsite as what you said, how to show/get route to a place using cell site ?

 

Thank you very much.

 

 

 

Regards,
Ferry

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: GPS Autonomous unable to get current location

I am not sure I follow your logic here.

 

A CellSite Location is a location.  A GPS Location is a location.  The only difference is the source of the location, the location can be used in the same way. 

 

You say

"According to what I read, Cellsite information cannot display route to any place."

 

Where have your read this?  Perhaps your interpretation is not correct so if we can read it we might be able to clear up any misunderstanding.  . 

Please use plain text.
Contributor
ferry_new2004
Posts: 16
Registered: ‎01-18-2011
My Device: 9800
My Carrier: AT&T

Re: GPS Autonomous unable to get current location

Thank you Peter, this is what I read:

 

The Cell Site mode determines the location of the device solely based on cell tower
locations and signal strengths. This provides only location, not speed or other route
information. The accuracy is generally poor. Unlike the real GPS methods, it is
almost instantaneous.

 

I interpreted "other route information" as getting direction.

What does  "other route information" mean ?

 

Thank you.

 

Regards,
Ferry

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: GPS Autonomous unable to get current location

In this situation I would be confident that the route information that is lacking is things like is direction or bearing.  I do not think this means you can't use a Cell Site Location for planing a route between where you are (aprproximately in the case of Cell Site) and where you want to go. 

Please use plain text.
Contributor
ferry_new2004
Posts: 16
Registered: ‎01-18-2011
My Device: 9800
My Carrier: AT&T

Re: GPS Autonomous unable to get current location

Thank you very much for your reply.

It is clear now.

 

Regards,

Ferry

Please use plain text.