O'Reilly logo

Near Field Communication with Android Cookbook by Vitor Subtil

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring a Wi-Fi network

I'm sure you've experienced friends asking you for your Wi-Fi password when they come over, and I bet that most times the answer is "Don't remember," "I'm not sure," or "Let me check the router sticker." In this recipe, we will learn how to create an application to write a simple Wi-Fi network configuration to an NFC tag that allows us to stick it somewhere around the house.

How to do it...

We will store three Wi-Fi network fields, the SSID, the security type, and the password in the tag. When we read it, we will add the network to our device and enable the Wi-Fi adapter:

  1. Open Eclipse and create a new Android application project named NfcBookCh9Example2 and package named nfcbook.ch9.example2.
  2. Make sure the AndroidManifest.xml ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required