activating wifi hotspot from widget on FroYo

Search This thread

ilanB

Member
May 19, 2007
13
2
Hi,

Just updated to FroYo mainly for the tether option. It works great and I can just surf while the phone is in my pocket / bag.

what I miss is a faster way to activate it.

I didn't see an option to have shortcut to the home screen (via - shortcuts - settings) and I can't find a widget that will allow it.

Any ideas?

Thanks
Ilan
 

jmdsdf

Senior Member
May 19, 2010
64
10
Here's something close, it's not exactly what you want (it's a program that just opens Menu | Settings | Wireless | Tethering & Portable hotspot and then exits).

It took more time to for me to write this post (and figure out how to insert a link!) than for me to code it:

jmdsdf.yi.org/share/TetherSettings.apk
 

Attachments

  • TetherSettings.apk
    6.9 KB · Views: 567
Last edited:

bluehaze

Senior Member
May 28, 2007
262
0
Any chance you can make the "t" in tether that shows on the icon label a capital "T"? Sorry i'm a bit OCD so it kind of drives me crazy but I really appreciate the quick access to the tether settings comes in quite handy!

Thanks
 

ilanB

Member
May 19, 2007
13
2
Wow great that was exactly what I was looking for.

Thanks, I wish I could program as easely as I'm posting questions :) because I'm very good in aking :p

Ilany

-------------------------------------
Sent via the XDA Tapatalk App
 

jmdsdf

Senior Member
May 19, 2010
64
10
Here's the code:

public class tethersettings extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

// load tether setting dialog
Intent intent = new Intent();
intent.setAction(Intent.ACTION_MAIN);
ComponentName com = new ComponentName("com.android.settings", "com.android.settings.TetherSettings");
intent.setComponent(com);
startActivity(intent);

// exit
finish();
// kill process
android.os.Process.killProcess(android.os.Process.myPid());

}
}
 

jmdsdf

Senior Member
May 19, 2010
64
10
Updated with capitalization:

jmdsdf.yi.org/share/TetherSettings.apk

Three other apps with a similar idea (for changing APNs, data settings and wifi settings):

jmdsdf.yi.org/share/ApnSettings.apk
jmdsdf.yi.org/share/DataSettings.apk
jmdsdf.yi.org/share/WifiSettings.apk
 

pikipirs

Senior Member
Jan 23, 2009
316
85
android.ccpcreations.com
Yes, using AnyCut, the Tethering settings activity is the 7th "Settings" activity in the list that AnyCut produces when creating a new shortcut.

Or you can use an app that I've quickly put together for this purpose Someone's already posted a similar one, but since I've done it too, I might as well share it too. :) The icon's title is "Internet Sharing" and it has that green waves icon from android-wifi-tether app.
 

Attachments

  • TetheringShortcut.apk
    15.5 KB · Views: 627
Here's the code:

public class tethersettings extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

// load tether setting dialog
Intent intent = new Intent();
intent.setAction(Intent.ACTION_MAIN);
ComponentName com = new ComponentName("com.android.settings", "com.android.settings.TetherSettings");
intent.setComponent(com);
startActivity(intent);

// exit
finish();
// kill process
android.os.Process.killProcess(android.os.Process.myPid());

}
}

Hello jmdsdf, do you know if something similar can be done but to access directly Applications Management? You know, the screen where you can move apps to SD, force stop them and so on. I'm fed up of going to settings just to end an application. I've found that Advanced Task Manager doesn't kill tasks properly in Froyo, at least for me.

Sorry for the off-topic, didn't want to open a new thread just because of this.
 

pikipirs

Senior Member
Jan 23, 2009
316
85
android.ccpcreations.com
Hello jmdsdf, do you know if something similar can be done but to access directly Applications Management? You know, the screen where you can move apps to SD, force stop them and so on. I'm fed up of going to settings just to end an application. I've found that Advanced Task Manager doesn't kill tasks properly in Froyo, at least for me.

Sorry for the off-topic, didn't want to open a new thread just because of this.

Every activity (basically every screen on the system) can be shortcut this way. For the "Manage applications" screen, substitute "com.android.settings.TetherSettings" with "com.android.settings.ManageApplications".
 

nephroid

Senior Member
Feb 26, 2010
103
1
Newport Beach
Yes, using AnyCut, the Tethering settings activity is the 7th "Settings" activity in the list that AnyCut produces when creating a new shortcut.

Or you can use an app that I've quickly put together for this purpose Someone's already posted a similar one, but since I've done it too, I might as well share it too. :) The icon's title is "Internet Sharing" and it has that green waves icon from android-wifi-tether app.


Thanks for your help. I really wanted this! :)
 

worker1

Senior Member
May 29, 2010
307
12
Los Angeles
I just made this icon for tethering shortcuts

w98x6p.png


avkme9.png
 
Last edited:

antikryst

Senior Member
May 18, 2010
173
10
Quezon City
Updated with capitalization:

jmdsdf.yi.org/share/TetherSettings.apk

Three other apps with a similar idea (for changing APNs, data settings and wifi settings):

jmdsdf.yi.org/share/ApnSettings.apk
jmdsdf.yi.org/share/DataSettings.apk
jmdsdf.yi.org/share/WifiSettings.apk

works great. would be perfect if you could create a better icon that looks like the one froyo uses to show that tether is active.
 
works great. would be perfect if you could create a better icon that looks like the one froyo uses to show that tether is active.

If you have the Android SDK installed search for a file named android.jar, open it with winrar and go to res/drawable/drawable-hdpi and look for

stat_sys_tether_general.png
stat_sys_tether_usb.png
stat_sys_tether_wifi.png

Problem is these are the icons that appear in the notification bar, so they are quite small to use as an app icon, but a little bit of photoshop and you would be good.

PS: all credit goes to http://androiddrawableexplorer.appspot.com/