0

There are so many topics and unanswered questions regarding possibility to turn on/off GPS from inside a custom program so I decided to publish my own research.

As known to everyone any kind of available solution uses either a hack or at very least the root access. I tested quite a few GPS on/off widgets from Google Play and no one succeeded on all of my devices. The proposed more or less universal solution tested for:

  • Galaxy Tab 2.3.5 stock rooted,

  • Motorola Atrix 4G CM10 4.1.2,

  • HTC Evo 3D 4.0.2 custom rooted,

  • Galaxy Note II 4.1.2 stock rooted, custom rooted and CM10.1 4.2.1,

  • Galaxy S III 4.1.2 stock rooted.

Here is the short description of steps involved.

  1. Create a small stub APK which does nothing except receiving a custom broadcast with parameters and updates the security strings for GPS accordingly.

  2. Create a main GUI APK which included the above APK as a asset.

  3. The main APK should install the stub APK into /system/app and reboot the Android. Here is the only place actually requiring the root.

  4. The main APK provides additional goods like a widget, a main GUI panel, optional watchdog for Waze, Google Maps and iGo software and optional control of Bluetooth.

The full source code is here: http://rapidshare.com/files/1458124346/GPSToggler-20130222.7z

Please consider the above code as a sample and not like a final product. Bugs are possible, Also remember any tampering with /system/app area may soft-brick your device.

Hard bricks are unlikely but I accept no responsibility if your device bricked.

OGP
  • 950
  • 2
  • 11
  • 26
  • More advanced version with system module uninstaller and not requiring BusyBox is here: https://docs.google.com/file/d/0B7zaudXThbF8SVo2TGxfUGhjOXM/edit?usp=sharing or here http://rapidshare.com/files/3410445141/GPSToggler-20130226.7z – OGP Feb 26 '13 at 06:10
  • Turn On/Off GPS programatically see this [Click me](http://stackoverflow.com/questions/11373234/toggle-gps-on-root-devices-on-android/35320092#35320092) – Dayvon Mar 25 '16 at 13:51

0 Answers0