11-10-2009 05:20 AM
Hi,
i am developing one BB application. Which needs to collect user's location.
After all the serch on net for different types of modes like,
1. Cellsite
2. Assisted
3. Autonomous
I've decided to go for cellsite mode.
But i am having problem getting user's latitude and longitude.
I've refer the chart for compatibility of this mode with BB devices.
My codes are as below:
Criteria criteria = new Criteria(); criteria.setHorizontalAccuracy(Criteria.NO_REQUIREMENT); criteria.setVerticalAccuracy(Criteria.NO_REQUIREME NT); criteria.setCostAllowed(true); criteria.setPreferredPowerConsumption(Criteria.POW ER_USAGE_LOW); LocationProvider lPvd = LocationProvider.getInstance(criteria); if(lPvd!=null) { try { Location location = lPvd.getLocation(-1); QualifiedCoordinates qc = location.getQualifiedCoordinates(); setCurrentLocation(qc.getLatitude(), qc.getLongitude()); _gpsEnabled=true; } catch (Exception e) { Dialog.inform("Error : Getting location."); } } else { _gpsEnabled=false; }
I am having an exception in line
Location location = lPvd.getLocation(-1);
Please refer my codes and help me to solve the problem.
My second question is that, Will my codes work on Verizon carrier? As it has restriction to access LBS API.
Thanks.
11-10-2009 12:55 PM
I'm skeptical you will be able to get cell site based location on any device without using a 3rd party service like Google's. In particular, I have found that to get all location at all on a GPS-enabled Verizon Storm, I have to explicitly disable cell site based location by choosing the proper criteria.
Anyway, it would help if you told us what exception you are seeing.
11-10-2009 02:12 PM
Your code will not work on Verizon umless a) the app is signed, and b) you provide correct PDE info (provided to you when you become a Verizon developer).
See this article:
Having said that, you *can* utilize Autonomous mode on a Verizon Storm - they unlocked this in 4.7.