Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4244672
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:44:20+00:00 2026-05-21T03:44:20+00:00

Possible Duplicate: Enable GPS programatically like Tasker Ok, I know there is same question

  • 0

Possible Duplicate:
Enable GPS programatically like Tasker

Ok, I know there is same question asked before but all answer is “NO”. It is proven that enable GPS can be done in coding. Don’t believe? try out an application called “LOOKOUT”. I believe there is some workaround in order to achieve this.

I had read through lookout AndroidManifest.xml, what i found out they only use

<uses-permission android:name="android.permission.WRITE_SETTINGS"/>

Anyone have idea how they managed to do this? what is the secret behind? I personally managed to do this only if the application is install as system app and also require two permission

<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/>

My Code:

Settings.Secure.setLocationProviderEnabled(getContentResolver(), LocationManager.GPS_PROVIDER, true);

thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T03:44:21+00:00Added an answer on May 21, 2026 at 3:44 am

    According to this post on the Lookout support forums, they are unable to programmatically enable GPS.

    If Lookout could enable the GPS receiver remotely, then use the service, then turn it off – we would, but unfortunately there is no “disable GPS for everything other than Lookout” and if you have disabled the GPS receiver, no application can make use of it. Enabling the GPS receiver requires a user to do it manually.

    Edit: It looks like in the new version of Lookout they are most likely now exploiting a security flaw to accomplish this. It is not guaranteed to continue to work, but according to an open Android bug report from April 2010, code similar to the following will successfully programmatically enable/disable GPS (at least until the flaw is fixed):

    private void toggleGPS(boolean enable) {
        String provider = Settings.Secure.getString(getContentResolver(), 
            Settings.Secure.LOCATION_PROVIDERS_ALLOWED);
    
        if(provider.contains("gps") == enable) {
            return; // the GPS is already in the requested state
        }
    
        final Intent poke = new Intent();
        poke.setClassName("com.android.settings", 
            "com.android.settings.widget.SettingsAppWidgetProvider");
        poke.addCategory(Intent.CATEGORY_ALTERNATIVE);
        poke.setData(Uri.parse("3"));
        context.sendBroadcast(poke);
    }
    

    Also, see the question “Enable GPS programmatically like Tasker” and the XDA thread mentioned there for more discussion on how people have used this method.

    If you do use this method, you should make it clear to potential users of your application, since this is a HUGE potential privacy concern.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Enable GPS programatically like Tasker Anybody know how to enable the GPS
Possible Duplicate: Enable GPS programatically like Tasker I have a code for dial and
Possible Duplicate: How can I enable or disable the GPS programmatically on Android? I
Possible Duplicate: ffmpeg: videos before and after conversion aren't the same length Recently, I've
Possible Duplicate: Broadcast reciever for GPS state? Is there a listener that can notify
Possible Duplicate: How can I disable/enable UISearchBar keyboard's Search button? Can we disable the
Possible Duplicate: How to use enable_if to enable member functions based on template parameter
Possible Duplicate: Objective C for Windows iPhone development on Windows Is there any way
Possible Duplicate: Is there a regular expression to detect a valid regular expression? Regular
Possible Duplicate: How to enable or disable an anchor using jQuery? I've got an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.