Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
New Developer
Wli_BBForum
Posts: 33
Registered: 10-27-2009

Problem in cell site mode for GPS

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_REQUIREMENT);
criteria.setCostAllowed(true);
criteria.setPreferredPowerConsumption(Criteria.POWER_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.

 

Please use plain text.
New Developer
gudujarlson
Posts: 26
Registered: 10-23-2009

Re: Problem in cell site mode for GPS

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.

 

Please use plain text.
Developer
RexDoug
Posts: 4,649
Registered: 07-21-2008

Re: Problem in cell site mode for GPS

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:

 

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

 

Having said that, you *can* utilize Autonomous mode on a Verizon Storm - they unlocked this in 4.7.

 

Please use plain text.