Book Image

Near Field Communication with Android Cookbook

By : Subtil
Book Image

Near Field Communication with Android Cookbook

By: Subtil

Overview of this book

An easy-to-follow guide, full of hands-on examples of and real-world applications. Each recipe is explained and placed in context. If you want to learn how to create NFC-enabled Android applications, this is the book for you. Perhaps you already know a bit about Android application developments but have never used NFC, or perhaps you know a little about NFC android development but want some more advanced features and examples. In either case, this book will get you up and running quickly. You are expected to have Android programming knowledge.
Table of Contents (12 chapters)
11
Index

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:

  1. Open the project from the Configuring a Wi-Fi network recipe. Alternatively, create a new Android application project named NfcBookCh9Example3 and package named nfcbook.ch9.example3 and follow steps 2 through 20 from the previous recipe.

  2. Replace the network_sec_types string array in the res/values/strings.xml file to allow only the creation of WPA networks:

        <string-array name="network_sec_types">
            <item>WPA PSK</item>
        </string-array>
  3. Add the following string to the res/values/strings.xml file:

    <string...