官术网_书友最值得收藏!

Downloading Open NFC Android Edition

Application development using a virtual device is very popular in Android. Using virtual devices lets you use adapters that you may not have in your real device and test your application in several Android versions. The NFC adapter is no exception; so, even if your smartphone isn't an NFC-enabled device, there is no excuse not to use this awesome technology.

Android SDK tools provide us with Android Virtual Devices (AVD), which are device emulator configurations that allow us to configure hardware and software options. Open NFC Android Edition allows us to create an NFC-enabled AVD since there is no native support for that. We can then simulate a tag tap or a P2P tap, and the correct intent is launched like it would be in a real device.

Getting ready

The following are the settings required for this recipe:

  • Make sure you have a working Android development environment. If you don't, ADT Bundle is a good start. You can download it from http://developer.android.com/sdk/index.html.
  • It is assumed that Eclipse is the development IDE for Android.

How to do it…

We are going to download, extract, and verify the Open NFC files that are needed to get our virtual test environment up and running, as shown in the following steps:

  1. Open a new browser window and navigate to http://open-nfc.org.
  2. On the left navigation menu, click on Downloads.
  3. On the download list, select the 4.4.1 Open NFC for Android release. The download link's name should be Android Edition (SDK).

    At the time of writing this book, the current Open NFC release is 4.5.2 for Android 4.2.1, Jelly Bean; however, since this version has been reported to be faulty several times, we will use an older but stable version.

  4. Create a folder named NFCBook in your home directory and extract the downloaded archive.
  5. There should be a folder named android_sdk and at least one folder named OpenNFC_AddOn in it, where we will find an Android image on which we will create our AVD.
主站蜘蛛池模板: 贵州省| 荥经县| 关岭| 饶河县| 集安市| 西宁市| 巧家县| 荣昌县| 曲阜市| 鄂伦春自治旗| 姚安县| 河南省| 襄垣县| 石渠县| 霸州市| 获嘉县| 高陵县| 新泰市| 威远县| 瑞安市| 满洲里市| 罗甸县| 开原市| 星子县| 上饶县| 阿克苏市| 阿拉善右旗| 名山县| 呼图壁县| 大庆市| 安庆市| 临安市| 泉州市| 鲁山县| 广昌县| 东至县| 福清市| 宝坻区| 巩留县| 安康市| 广饶县|