Last active
December 11, 2015 04:08
-
-
Save creativedrewy/4542529 to your computer and use it in GitHub Desktop.
Sample Adobe AIR Android application class that handles incoming NFC intent data.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.desktop.NativeApplication; | |
import flash.events.InvokeEvent; | |
public class NFCDataHandling extends Sprite | |
{ | |
/** | |
* Constructor | |
*/ | |
public function NFCDataHandling() | |
{ | |
NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onApplicationInvoke, false, 0, true); | |
} | |
protected function onApplicationInvoke(event:InvokeEvent):void | |
{ | |
//If there is any intent data that was passed to the app - in this case, say an NFC URI - there | |
//will be data in event.arguments. It will be an array, and the first item will be | |
//the full URI string, i.e. {SCHEME}://{HOST}/{ARGS} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Read the blog post explaining how to use this:
http://creativedrewy.blogspot.com/2013/01/receive-nfc-data-in-adobe-air-android.html