12-19-2008 12:41 AM
OK.. More updates:
I sat with my phone tonight for two hours and tried every conceivable permutation of Criteria and LocationProvider that I could. Here are some things I've learned:
- If you set power consumption to POWER_USAGE_HIGH (THE DEFAULT!!), you will immediately get a providerStateChanged with newState as TEMPORARILY_UNAVAILABLE. All subsequent location updates will be invalid.
- If you set POWER_USAGE_LOW, you will no longer get the immediate TEMPORARILY_UNAVAILABLE state change. All of your location updates will still be invalid, but the state never changes (as it does with POWER_USAGE_HIGH).
- Default criteria does not work (WTF!!) because of item one in this list. No combination of vert/horiz accuracy/cost combinations made a difference. It always gave TEMPORARILY_UNAVAILABLE immediately on start.
So.. I am pretty exasperated. This is pretty much ridiculous. The documentation on this is abismal. ALL I WANT TO DO IS GET GPS WORKING ON A BLACK BERRY STORM WITH VERIZON WIRELESS. Please tell me what I'm doing wrong.
Here is my current criteria:
Criteria criteria = new Criteria();
criteria.setHorizontalAccuracy(1000);
criteria.setVerticalAccuracy(1000);
criteria.setCostAllowed(true);
criteria.setPreferredPowerConsumption(Criteria.POW
LocationProvider.getInstance(criteria).setLocation
I should note that an unlocked android phone is on the way, and my app is set to run on notification events when they get pushed in the firmware. Blackberry is the only one with these riduculous problems!
Please help!
12-19-2008 01:29 AM
GPS needs lots of power, hence POWER_USAGE_LOW disables it.
Have you tried just
Criteria c = new Criteria();
c.setCostAllowed(false);
This should result in an autonomous GPS fix.
12-19-2008 01:50 AM
If I set the power setting to high, I immediately get a temporarily unavailable state when the app starts. The app then returns invalid locations indefinitely.
If I set the power to low, it doesn't seem to disable it (unless it's doing that without changing the state)... I still get the invalid locations, as I mentioned above, but the state never changes.
12-19-2008 09:55 AM
So, I'm still waiting for my signing keys to get past the GPS Not Allowed error, but it does appear that the GPS isn't totally unlocked with Verizon. Is there a link/contact, etc. at Verizon to apply for the keys to fully unlock the LocationProvider class? The DB00591 knowledge base article just provides a link to the Verizon ZON program with no specific information that I can find.
Randall
12-19-2008 10:52 AM
There is a link on the ZON page to sign up as a "Verizon Developer".
12-19-2008 10:57 AM
asmq wrote:GPS needs lots of power, hence POWER_USAGE_LOW disables it.
Have you tried just
Criteria c = new Criteria();
c.setCostAllowed(false);
This should result in an autonomous GPS fix.
That criteria was discussed to be a non starter. I belive "Low Power" is for Cell Site location and not gps.
12-19-2008 11:13 AM
Ok guys, this is what I'm using, and it is currently working fine on a Storm on Verizon:
criteria.setCostAllowed(false);
criteria.setPreferredPowerConsumption(Criteria.POW
criteria.setPreferredResponseTime(16);
criteria.setHorizontalAccuracy(100);
lp = LocationProvider.getInstance( criteria );
lp.setLocationListener(new LocationListenerImpl(), 2, -1, -1 );
From previous playing around with CDMA providers (Sprint and Verizon), it can be very tricky getting the right combination. Even the interval, timeout and maxage in the setLocationListener call is difficult to get right, because often values you think would work don't. For example, in theory to keep the GPS hot you should be able to use any interval less than 10, but in our experimenting, anything more than 2 was returning very inconsistent results. I've never tried using longer intervals, since we need to keep the chip active for our application.
12-19-2008 11:52 AM
12-19-2008 01:27 PM
12-19-2008 01:30 PM