Detect when application launches via NFC in ICS

ICS presents the possibility of sharing the application via Android Beam using NFC, and as I understand it, if the application is open on the DeviceA device, it will automatically run on the DeviceB device (if it is already installed on it, otherwise the Market open application) when the device are close enough and the user β€œtouches the beam”. Is there a way, within the framework of Launcher's action, to determine if it was launched due to an NFC message or due to user interaction?

+1
android nfc
source share
2 answers

Only NFC start begins when a beam occurs. This is ACTION_NDEF_DISCOVERED, ACTION_TECH_DISCOVERED or ACTION_TAG_DISCOVERED. See the shine section of the dev manual for how to handle beams: http://developer.android.com/guide/topics/nfc/nfc.html#p2p

0
source share

If the Android Beam (or NDEF) message contains an Android application entry, http://developer.android.com/guide/topics/nfc/nfc.html#aar , as a result of this intention, there will be no ACTION_NDEF_DISCOVERED action to launch the application, but ACTION_MAIN This method can be used to run any application, including applications that do not filter for NFC purposes.

0
source share

All Articles