On Mon, Mar 7, 2011 at 11:10 AM, Jake Colman <[email protected]> wrote:
>>>>>> "MM" == Mark Murphy <[email protected]> writes:
>
>   MM> On Mon, Mar 7, 2011 at 8:55 AM, Jake Colman <[email protected]> wrote:
>   >> 1) Why would getBestProvider return null?
>
>   MM> GPS is not POWER_LOW, AFAIK.
>
>   >>  Shouldn't it always be ble to tell me something?
>
>   MM> If you ask for criteria that cannot be met, you will get null.
>
> The API docs say that all criteria but cost will be relaxed until a
> match can be found.  Is the API buggy or did I misunderstand the
> intention?

Ah, no I had forgotten that. My apologies. Note that this will only be
for getBestProvider(), not getProviders().

> Hmmmmm.  That never occurred to me!  I didn't think there was a separate
> option for network locating; I thought it was just for GPS.

At least nowadays, they should all have individual checkboxes.

> Because it might be disabled as you stated above?

Correct.

> Ok.  So what is recommended practice for my location needs?  I am happy
> with a coarse location so if network and GPS are both available I'd
> prefer using the network (uses less power and can obtain a fix more
> quickly).  On other hand, if all you have is GPS I certainly don't mind
> making use of that.
>
> Is removing the power requirements the proper way to achieve that?  if
> my own phone had this issue I would test it.  Since I am sending a beta
> app to my user I'd rather have an idea of what to expect before writing
> some new code.

Make sure you have ACCESS_FINE_LOCATION in your permission roster --
otherwise, you can't get GPS as an option.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training Worldwide: http://commonsware.com/training

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to