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
Developer
Posts: 30
Registered: ‎07-15-2008
My Device: Not Specified

Location using CellSite (Criteria.POWER_USAGE_LOW) help

Hi,

 

Trying to get a fix using the CellSite method, i.e:

 

Criteria mycriteria = new Criteria();

mycriteria.setHorizontalAccuracy(Criteria.NO_REQUIREMENT);mycriteria.setVerticalAccuracy(Criteria.

NO_REQUIREMENT);

mycriteria.setCostAllowed(true);mycriteria.setPreferredPowerConsumption(Criteria.

POWER_USAGE_LOW);

_locationProviderCellFix = LocationProvider.getInstance(mycriteria);

Location myLoc = _locationProviderCellFix.getLocation(-1); //Single Fix

 

longitude = myLoc.getQualifiedCoordinates().getLongitude();

latitude = myLoc.getQualifiedCoordinates().getLatitude();

 

However _locationProviderCellFix is returning a Null object, my device carrier is Vodofone UK, who has confirmed that they do support this.  Can anyone shed some light on this.

 

Also since CellSite does not use the GPS chip, should this work on a device without GPS, as when I switch GPS off, nothing works.

 

Thanks in Advance

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Location using CellSite (Criteria.POWER_USAGE_LOW) help

I can confirm that I too see this.  My code, which was compiled on JDE 4.2.1 and is running on a Vodafone UK Bold, is as follows:

 

Criteria mycriteria = new Criteria(); mycriteria.setHorizontalAccuracy(Criteria.NO_REQUIREMENT); mycriteria.setVerticalAccuracy(Criteria.NO_REQUIREMENT); mycriteria.setCostAllowed(true); mycriteria.setPreferredPowerConsumption(Criteria.POWER_USAGE_LOW); mycriteria.setCostAllowed(true); mycriteria.setAltitudeRequired(false); mycriteria.setPreferredResponseTime(Criteria.NO_REQUIREMENT); mycriteria.setSpeedAndCourseRequired(false); _locationProvider = LocationProvider.getInstance(mycriteria); // At this point locationProvider is null // Note that I tested using the same settings as the original poster and also go null. // I then added the other criteria in the hope that it might help but it did not.

 

BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Location using CellSite (Criteria.POWER_USAGE_LOW) help

Please note that the BlackBerry Bold supports autonomous mode only.  You can verify this here:

 

What Is - The BlackBerry smartphone models and their corresponding GPS capabilities
Article Number: DB-00615

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800703/What_Is...

 

 This chart lists the mode chosen based on the supplied criteria.

 

How To - Define criteria to retrieve a GPS fix
Article Number: DB-00461

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800703/How_To_...

 

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 68
Registered: ‎10-26-2008
My Device: Not Specified

Re: Location using CellSite (Criteria.POWER_USAGE_LOW) help

If this is true, "Please note that the BlackBerry Bold supports autonomous mode only." how are we supposed to grab GPS location quickly (and indoors) on the Bold? Even if the user is outside, if it takes 3+ min to get the GPS location, the app will be useless!
Highlighted
New Developer
Posts: 22
Registered: ‎07-17-2008
My Device: Not Specified

Re: Location using CellSite (Criteria.POWER_USAGE_LOW) help

My understanding is that cellsite is CDMA only and works only with the blessling of the carrier.  It works fine for me on Sprint and is spectacular.  It does not work for me on Verizon, but I haven't tried to figure out why.  As for GPS,it is an inherently hard problem.  GPS transmitters are very far away and transmit slowly and weakly on a wavelength that does not propagate through walls very well.  The use case was not phones inside buildings but missiles flying in space...

 

Developer
Developer
Posts: 319
Registered: ‎07-20-2008
My Device: Not Specified

Re: Location using CellSite (Criteria.POWER_USAGE_LOW) help

Check out this link...

 

http://www.anddev.org/poor_mans_gps_-_celltowerid_-_location_area_code_-lookup-t257.html

 

Using the cellid and lac, you should be able to get lat/lon from Google.

 

 

BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Location using CellSite (Criteria.POWER_USAGE_LOW) help


MRJAVA wrote:
If this is true, "Please note that the BlackBerry Bold supports autonomous mode only." how are we supposed to grab GPS location quickly (and indoors) on the Bold? Even if the user is outside, if it takes 3+ min to get the GPS location, the app will be useless!

 

This is where the GPS Extended Ephemeris support comes into play, which can allow a fix to be achieved much faster (10-20 second range is normal).  It allows the device to narrow down its search for satellites that should be visible in its area.

 

Quote from the link below:

 

"Note: The BlackBerry® Infrastructure does not store the locations of BlackBerry smartphones. When the BlackBerry smartphone sends the identity of the wireless service provider with which it is registered to the BlackBerry Infrastructure, the BlackBerry Infrastructure retrieves the ephemeris data for each GPS satellite signal on the wireless network and sends it to the BlackBerry smartphone. The GPS receiver on the BlackBerry smartphone then knows the location of each GPS satellite in the wireless coverage area. The BlackBerry smartphone uses this data to calculate its own location, but the BlackBerry smartphone does not report its location to the BlackBerry Infrastructure."

 

http://www.blackberry.com/btsc/search.do?cmd=displayKC&docType=kc&externalId=KB14430&sliceId=2&docTy...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 68
Registered: ‎10-26-2008
My Device: Not Specified

Re: Location using CellSite (Criteria.POWER_USAGE_LOW) help

Hi Mark,

 

maybe I missed something, but how do I use this feature? Can you tell me what classes/functions can be used to grab the GPS location in the 10-20 sec range?  Code samples would be great as always.   Smiley Happy

BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Location using CellSite (Criteria.POWER_USAGE_LOW) help

[ Edited ]

There isn't anything you need to do within your application to take advantage of this.  It will be used whenever possible when you are requesting a fix in autonomous mode.  Typically as long as a user has been connected to the wireless network this should work.  It may not be available if a user has just turned on their BlackBerry handheld in a new location (i.e. getting off of a plane and turning their handheld on).

 

This feature requires BlackBerry handheld software version 4.2.1 or higher.

Message Edited by MSohm on 05-07-2009 01:21 PM
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 68
Registered: ‎10-26-2008
My Device: Not Specified

Re: Location using CellSite (Criteria.POWER_USAGE_LOW) help

Hi Mark,

 

the device I am using to test has os version 4.6.x.x and even after it was turned on for a long time, it takes upwards of 3 minutes to get a GPS fix.

 

Can you recommend things I can try to speed this up?  Any code snippets you can share?

 

Thank you.