4

I was reading about Near Field Communication on Android and was wondering if there is any way to retrieve information from one phone by another. So this can be done in two ways :

  1. Phone(Retriever) connects via NFC to another Phone(Client). The Client does not have any special application installed, but we have an application installed in the Retriever. The Retriever then fires a query and can it get some information about the Client device(say the owners email address)? (Remember no special application is installed in the Client phone).

  2. In this scenario the Client has an appropriate application installed that captures the NFC query, parses it, retrieves the relevant data from the Client and sends back an NFC message to the Retriever.

My background research says that it should be possible through the second way. I have two questions:

1.Is it possible through the first method. If yes then how?

2.Could you suggest me some good tutorial for the second method

NFC guy
  • 10,151
  • 3
  • 27
  • 58

2 Answers2

1

Both scenarios are currently not possible with Android devices. Android apps on devices with NFC can push data via NFC to another device. There is no way to query and retrieve information (pull data) via NFC on Android.

With NFC tags, the Android device acts as a card reader/writer device. In that case the Android device can interrogate the tag and retrieve information from it.

NFC guy
  • 10,151
  • 3
  • 27
  • 58
  • What about two pushes (when both devices have the same app)? Device **A** pushes data to device **B**, and on receiving it, device **B** pushes data to device **A**. – Dennis Dec 05 '12 at 02:49
  • 1
    Yes, that would be very useful, indeed. Unfortunately it is currently not possible. After receiving data, the Android Beam UI (the zooming out of the screen) disappears. – NFC guy Dec 05 '12 at 09:49
0

From my experience both devices must have an app that is reade to receive a NFC event, the "caller" must have the application in foreground, when it gets close to other device, the "beam" appears and the NdefMessage is sent, on the receiver each application that has an intent filter for that MIME-TYPE can get launched and process the nfc event.

The reference as a starting point is this and the project sample from the API.

Goofyahead
  • 5,874
  • 6
  • 29
  • 33