History log of /frameworks/base/core/java/android/nfc/NfcEvent.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
2d68a6ba3c1354f363e5ee77448f163664bf47d9 27-Sep-2011 Scott Main <smain@google.com> docs: mix of BT and NFC javadoc updates
Add Health profile to various discussions about profiles
Add descriptions to NFC interfaces, tweak some desciptions, and fix some broken links

Change-Id: Ib89434c78a4ad60b4358dca9a6c335451d1c4125
/frameworks/base/core/java/android/nfc/NfcEvent.java
c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9 23-Aug-2011 Nick Pelly <npelly@google.com> Improve NDEF push API

Introduce
setNdefPushMessage()
setNdefPushMessageCallback()
setNdefPushCompleteCallback()

Deprecate public API
enableForegroundNdefPush()
disableForegroundNdefPush()

Hide & Deprecate staged (public but never released) API
enableForegroundNdefPushCallback()

The new API's do not require the application to explicitly call
enable()/disable() in onPause()/onResume(), we use a Fragment behind
the scenes to manager this automatically.

NDEF Push can be disabled by using a null parameter, so each
enable()/disable() pair is collapsed to a single set() call.

Application code should now look something like:

public void onCreate() {
NfcAdapter adapter = NfcAdapter.getDefaultAdapter(this);
if (adapter != null) { // check that NFC is available on this device
adapter.setNdefPushMessage(myNdefMessage, this);
}
}

And that's it - no need to explicitly hook into onPause() and onResume() events.

Also - introduce a generic NfcEvent class that is provided as a parameter on
all NFC callbacks. Right now it just provides the NfcAdapter, but using
the wrapper classes allows us to add more fields later without changing
the callback signature. (i'm thinking Bluetooth).

Change-Id: I371dcb026b535b8199225c1262eca64ce644458a
/frameworks/base/core/java/android/nfc/NfcEvent.java