NFC - Open a webpage on smartphone using NFC connection

Many models of Android smart phone support NFC feature, and numerous of NFC applications are developed for inspection and modification of NFC Tag.
In this example, we establish NFC connection between Ameba and a smartphone, and open a webpage on the smartphone via a NFC event. If you are not familiar with NFC, please read Introduction to NFC first.
  • Ameba x 1
  • Smartphone with NFC feature x 1


If we want to use NFC feature of Ameba, we have to first weld the NFC antenna on Ameba. As shown in the figure below:


Next, make sure the NFC feature of the smartphone is turned on:


If NFC is turned on, the NFC icon appears in the status bar: 3

Then open the example, “File” -> “Examples” -> “AmebaNFC” -> “UriWebPage”

Compile and upload to Ameba, then press the reset button.
Bring the back of the smartphone close to the NFC antenna of Ameba.

If the NFC connection is established successfully, some system might open the webpage directly, while some system pop an alert window to confirm whether you want to open the webpage.

Code Reference

The NFC API of Ameba provides the common NDEF Class. In the sample code, appendRtdUri() is used to set the webpage to be opened on the smartphone (the “http://www.” part is not needed).


Next use NFC.begin() to start the NFC module.

Please confirm that QQ communication software is installed