Wednesday, May 02, 2012

Android 1-Click Shortcuts using SL4A

Sometimes it takes 3-4 clicks to get to our often used settings page on Android phone, such as Mobile Network Settings (Settings - Wireless and networks - Mobile Networks). With SL4A, it's really easy to create a 1-click shortcut on the Home screen.

1. Create new script in SL4A, copy one of the following codes

Shortcut to Mobile Network Settings (Use packet data, 2G/3G)

droid = android.Android()
droid.startActivity('',None,None,None,False,'com.android.phone','com.android.phone.Settings')


Shortcut to Mobile AP/Tethering Settings

droid = android.Android()
droid.startActivity('',None,None,None,False,'com.android.settings','com.android.settings.TetherSettings')


2. Long press on Home Screen, choose Shortcut, choose Scripts, select the script you wrote on Step 1

3. Done :)