LightBlog

samedi 16 avril 2016

Use your Android device as an automatic wifi adapter

I currently use an old Galaxy 5 as a wifi adapter for my computer. I wrote a small adb script which turns on tethering on boot.
Code:

adb shell input keyevent KEYCODE_POWER
adb shell am start -n com.android.settings/.TetherSettings
TIMEOUT 2
adb shell input keyevent 66 # enter
adb shell input keyevent 66 # enter
adb shell input keyevent KEYCODE_POWER

I use the timeout command because the phone is really slow and sometimes it does not properly load the settings before pressing the next buttons.
I wanted to ask if there was a better way of doing it, using better commands or something. Also is there a way to turn off tethering when computer is shut down?


from xda-developers http://ift.tt/1Sl6h7n
via IFTTT

Aucun commentaire:

Enregistrer un commentaire