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
canamgroup
Posts: 117
Registered: ‎07-16-2008
My Device: Not Specified

What is the default GPS mode when no criteria is specified for the LocationProvider?

Hi,

 

I'm just curious about the default GPS mode used when no criteria is specified.

I'm using LocationProvider.getInstance(null) instead of specifying a critera.

 

I saw the table with all default values here: 

http://www.blackberry.com/developers/docs/4.2.1api/index.html

 

I understand that the default values are always the least restrictive options... but was wondering which GPS mode (Autonomous, Assisted, Cellsite) is used when all values at the least restrictive?

Is it always the same mode? Or is the mode chosen automaticaly by the implementation each time based on some logic?

 

I'm just trying to fully understand all this.

 

Thanks!

Please use plain text.
New Developer
190B
Posts: 14
Registered: ‎10-15-2008
My Device: Not Specified

Re: What is the default GPS mode when no criteria is specified for the LocationProvider?

Based on the API table that is provided: http://www.blackberry.com/developers/docs/4.2.1api/javax/microedition/location/Criteria.html

 

The criteria, when at default will use the Assisted Location Provider. You can see this because when the horizontal/vertical accuracy is at it's default (no requirement), the cost is at its default (true), and the power consumption is at its default (no requirement), the resulting mode in the table is Assisted.

 

From my tests of using the GPS, this has held true for my own applications. Without any criteria, it's always Assisted. The problem I'm having is trying to get it to the Autonomous mode. :smileytongue: 

Please use plain text.
Developer
canamgroup
Posts: 117
Registered: ‎07-16-2008
My Device: Not Specified

Re: What is the default GPS mode when no criteria is specified for the LocationProvider?

OK, I just wasn't sure that, for example, if the cost is not specified (default to true), the implementation would automaticaly force the cost flag to be true and don't use other modes that have the cost flag set to false... or it would use modes that has either value since the cost is not specified.

 

Just out of curiosity, what problems are you having using the Autonomous mode?

 

Thanks!

Please use plain text.
New Developer
190B
Posts: 14
Registered: ‎10-15-2008
My Device: Not Specified

Re: What is the default GPS mode when no criteria is specified for the LocationProvider?

[ Edited ]

Well, I haven't been able to get the Criteria set such that it makes the LocationProvider work in Autonomous mode. It's always going to Assisted mode. The way I'm testing this is by calling the phone while trying to use the GPS. Only Autonomous mode will allow the LocationProvider to aquire coordinates while in a call.

 

On a side note, does anyone know how to truly see what mode the GPS is working in? I have seen it done in other software, but don't see how to implement it.

Message Edited by 190B on 12-04-2008 02:31 PM
Please use plain text.
Administrator
MSohm
Posts: 14,446
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: What is the default GPS mode when no criteria is specified for the LocationProvider?

There is currently no API to query for this.  Note that not every BlackBerry model supports autonomous mode.  The following chart lists the supported modes for different BlackBerry models.

 

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...

 

I also recommend looking at this link.

 

How To - Manage simultaneous GPS and phone usage on the BlackBerry 8703e and 7130e smartphones 
Article Number: DB-00611

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
Please use plain text.
New Developer
190B
Posts: 14
Registered: ‎10-15-2008
My Device: Not Specified

Re: What is the default GPS mode when no criteria is specified for the LocationProvider?

Thank you for your links Mark. Your responses are always informative and appreciated.

 

I'm currently testing this on two different BlackBerries, both of which have true GPS on them (8310 and 9000). However, our service provider is not a US provider, so I cannot check on the chart. We areinvestigating whether or not there is a block on the Autonomous GPS like some US carriers do unless you pay for their additional services.

 

The ability to get a GPS fix during a phone call is actually not a priority for us, and not a problem. The only reason I was doing that was to test whether or not it was a true Autonomous GPS mode that was on.

Please use plain text.
Developer
canamgroup
Posts: 117
Registered: ‎07-16-2008
My Device: Not Specified

Re: What is the default GPS mode when no criteria is specified for the LocationProvider?

I just did a test with my Blackberry Curve 8330 with Bell Canada.

 

I'm getting a GPS coordinates every 15 minutes using .getLocation() combined with a timer (I'm not using LocationListener).

 

I called my Blackberry with my other phone one minute before the next .getLocation()... and waited about 10 minutes.

I didn't receive any GPS coordinates.

 

However, as soon as I hung up the phone, I received my GPS coordinates.

If I understand correctly, that means I was able to get a GPS coordinates while on the phone... but the Blackberry was not able to send it yet cause the line was busy... but somehow managed to queue my network connection (http) and then sent it the second after the line was free.

 

Does that mean my GPS is working with the "Autonomous" mode?

Please use plain text.
New Developer
190B
Posts: 14
Registered: ‎10-15-2008
My Device: Not Specified

Re: What is the default GPS mode when no criteria is specified for the LocationProvider?

That's an interesting take on what's happening. I did not really consider that. In my application, the BlackBerry is sending the coordinates back via a socket connection. Would a phone call block the socket connection?

 

If that's the case, I cannot rule out Autonomous GPS being used, because I also have similar circumstances where as soon as I hang up, the coordinates come back (usually about 5 seconds after).

 

How are you communicating back to your server application canamgroup?

Please use plain text.
Developer
canamgroup
Posts: 117
Registered: ‎07-16-2008
My Device: Not Specified

Re: What is the default GPS mode when no criteria is specified for the LocationProvider?

Based on my tests, a phone call seems to block every network connections.

For instance, I tried to send an e-mail to my Blackberry while on the phone and I get it only when I hang up.

 

To communicate with my server, I'm using a HttpConnection : 

HttpConnection con = (HttpConnection)Connector.open(URL); // open URL connection
con.setRequestMethod(HttpConnection.POST); // POST method
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
OutputStream out = con.openOutputStream(); // post data as a stream
out.write(data.getBytes());
int responseCode = con.getResponseCode(); // push data and receive response code
if (responseCode == HttpConnection.HTTP_OK) {
//success
}
if (con!=null) con.close(); // close the URL connection

Could it be "Autonomous" mode?
Please use plain text.
New Developer
190B
Posts: 14
Registered: ‎10-15-2008
My Device: Not Specified

Re: What is the default GPS mode when no criteria is specified for the LocationProvider?

I think it's very possible that it's autonomous mode. Check what kind of accuracy you are getting. I know that on my application, I'm getting back coordinates that are within 5 metres accuracy in both horizontal and vertical aspects. And I am starting to think that this has got to be autonomous mode.

Please use plain text.