Starting a Wi-Fi hotspot
The Android Wi-Fi hotspot feature is just incredible, and I can't help but love it! It allows me to have Internet access on my laptop everywhere. However, one thing that I don't like is the number of steps and the time needed to enable this feature. In this recipe, we will see how to reduce that time to just a few seconds and the steps to just one.
How to do it...
We will write a custom hotspot configuration and turn it on with one tap:
Open the project from the Configuring a Wi-Fi network recipe. Alternatively, create a new Android application project named
NfcBookCh9Example3
and package namednfcbook.ch9.example3
and follow steps 2 through 20 from the previous recipe.Replace the
network_sec_types
string array in theres/values/strings.xml
file to allow only the creation of WPA networks:<string-array name="network_sec_types"> <item>WPA PSK</item> </string-array>
Add the following
string
to theres/values/strings.xml
file:<string...