Sunday, December 04, 2011

Making Android NFC Demo work.

This is a short article on how to make NFC Demo work. The NFC Demo is one of Android samples available from either the Android developer site or your local folder after installing Android SDK 2.3.3 or higher.

  - http://developer.android.com/resources/samples/NFCDemo/index.html
  - C:\Program Files\Android\android-sdk\samples\android-10\NFCDemo (in Windows)

The NFC Demo uses some Google collection library, which is available in

  - http://code.google.com/p/guava-libraries/

First, download guava-10.0.1.jar, which is the version I see at the time of writing this article.

Second, you create a new Android project, say, named NFCDemo. You don't need to create an Activity, so you uncheck "Create Activity" during your set up.

Third, once you created an android project, you  copy all files under the src and res in the NFCDemo sample to your project. Don't forget to overwrite AndroidManifest.xml in your project with that in the sample.

Of course, you have to add the downloaded guava-10.0.1.jar to the external jar path of your project.

That's it! Now you are ready to run it on Android Emulator.

If you have any questions, please post them as a comment to this article.