Thursday, June 17, 2010

[android-developers] Re: switching GPS on and off

Hope this is some help, 2 use cases:

Case 1 - starting with the GPS not enabled in the device settings
User enables the GPS --> GPS is now enabled but not active
Application uses the GPS --> GPS is now active
{GPS things happen}
Application stops using the GPS --> GPS goes back to not active

Case 2 - starting with the GPS not enabled in the device settings
Application uses the GPS --> GPS does NOT become active
{errors}
Application stops using the GPS --> no change in GPS state

/Richard

On Jun 17, 7:14 pm, kamiseq <kami...@gmail.com> wrote:
> once again, maybe it is too much sun over here :)
>
> 1. gps is on (powered, whatever) when some app tries to obtain
> location info
> 2. gps is off if there is no app looking for location
> 3. you then said that
> "For example, HTC Sense phones have a home screen feature that looks
> like an on/off switch for GPS. That, however, controls whether GPS is
> enabled."
>
> so there is some other state that gps can be in and it can be
> controlled by application. and yes I dont really understand the
> difference between on and enabled.
>
> On 17 Cze, 16:07, Mark Murphy <mmur...@commonsware.com> wrote:
>
> > On Thu, Jun 17, 2010 at 10:04 AM, kamiseq <kami...@gmail.com> wrote:
> > > ok, so if I have a widget on my desktop on the phone and gps is switch
> > > off (dispabled) how should I "enable/disable" it. I couldn't find
> > > anything on that.
>
> > The user does that (e.g., via the Settings application). Your code
> > cannot change whether GPS is enabled or disabled.
>
> > --
> > Mark Murphy
> > CommonsWare
> > mmur...@commonsware.comhttp://commonsware.com

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

No comments:

Post a Comment