google-glassandroid-settings

How to disable WiFi on Glass for testing?


I want to develop a receiver for Google Glass which will detect the WiFi state of Glass and depending on that state show some information to user.

The receiver will listen for android.net.wifi.WIFI_STATE_CHANGED so that I can catch the event and after that check the status of the internet. It will not only detect the internet availability but will also show if Glass is timing out when pinging any specific IP address from any apps of glass.

I have tested the receiver on another Android device and it's working fine. But now I want to test the app on Glass. In order to test, I want to disable WiFi; however, Glass only shows options in settings for forgetting the current WiFi network and connecting to a nearby network.

How can I disable WiFi on Glass temporarily?


Solution

  • From default settings of glass its not possible to disable WiFi. To do the things you have to follow some instructions and install android default launcher and settings so that you can get the settings UI as your android device and do the rest of the desire works.

    I am describing the whole process here :

    1. At first you have to download these two apk.
    1. After that you have to install these two apps into your glass by ADB :

      1. adb install Settings.apk          2. adb install Launcher2.apk    
      

    Please be careful not to check the “Use as Default” box or you will not be able to access your Glass Settings until you uninstall Launcher2.apk.

    After complete installing go to your settings and select launcher. After selecting android default launcher you will get the setting UI as like as your android device. Now you can do whatever you want like WiFi enable/disable, Bluetooth enable/disable and etc. But there have some issues which not working like Bluetooth Tethering, Data Usage , Airplane Mode and some more features.

    Details process of using the settings and launcher and not working features.

    If you want to uninstall the installed app at first see your app packages name and delete the app from the devices using below script :

    adb shell pm list packages [see all of your installed app list]
    
    abd shell pm uninstall -k com.packagename [your app by specific package name]
    

    After above script you will get your previous glass settings.

    Here is the excellent video where all these process has been described in nice way.

    Voiding Your Warranty: Hacking Glass