Reputation: 5657
Does Blackberry API provide any methods to determine which one, GPS
or Geolocation
is better in current situation (according to signal level, network bandwidth and any other environment properties)?
Upvotes: 0
Views: 257
Reputation: 31045
There's many, many different algorithms you could use to determine which is the optimal location mode to use.
A well-tuned algorithm would have to account for things like
I'm sure I'm missing some other factors, but hopefully you can see that it's not a simple problem that can be solved without knowing something about your app and network deployment.
Also, this kind of algorithm for BlackBerry (Java) apps has traditionally taken a lot of work to optimize. As such, many developers (or clients) would consider this a closely-guarded business secret. So, it might be hard to find someone to publish their algorithm (but it doesn't hurt to ask, right?).
That said, you might at least take a look at the BlackBerry Simple Location API, which is an open source implementation of a basic algorithm that selects between GPS and Geolocation modes (if you allow it to use both). From the Javadocs (for the Optimal mode):
Operates in both Geolocation and GPS mode based on availability. First fix is computed in Geolocation mode, subsequent fixes in Standalone mode. However if Standalone mode fails, falls back to Geolocation mode temporarily until a retry is attempted in Standalone mode after a certain waiting period has passed. See
setRetryFactor(int)
.For single fix calls to
getLocation(int)
, Geolocation mode is used first with a fallback to Standalone mode if Geolocation mode fails.
I see you're in Belarus, but I don't know where your clients, or users are. If they're in the US, you may also need to consider something like Nav Builder Inside for geolocation if your app will support the Verizon network.
Anyway, I know this probably isn't the answer you wanted, but maybe it's a start?
Upvotes: 4