Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

GDD2011 OpenCall ADK "NFC for Everybody" design document


Published on

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

GDD2011 OpenCall ADK "NFC for Everybody" design document

  1. 1. “Nfc for Everybody” Design Document NFC( FeliCa ) / NFC Nexus One XOOM NFC Components USB Serial FeliCa / Accessory ADK Board RC-S620/S ( ) IDm( ) NDEF Message NDEF Intent NFC Suica Readertaglet NFC↑
  2. 2. Google I/O 2011 ADK FeliCa Push (NDEF_DISCOVERED) Flow (Android application) in Accessory 1. private List<ActivityInfo> findForNdef(String mimetype) { final Intent i = new Intent(NfcAdapter.ACTION_NDEF_DISCOVERED); 2. i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.setType(mimetype); 3. IDm( final List<ResolveInfo> resolvedActivities; resolvedActivities = getPackageManager().queryIntentActivities(i, NDEF Messages) PackageManager.GET_META_DATA); final List<ActivityInfo> result = new ArrayList<ActivityInfo>(); 4. Android for (ResolveInfo resAct : resolvedActivities) { result.add(resAct.activityInfo); } 5. in Device return result; } 6. Intent 7.Intent startActivity (Android application) private Intent createIntentForTag(byte[] idm, NdefMessage[] msgs) throws IllegalAccessException, InvocationTargetException { IDm build materials // sTagFactory is Method instance of Tag#createMockTag(...) final Tag tag = (Tag) sTagFactory.invoke(null, new Object[] { (a part of Arduino firmware) idm, //RC-S620/S static RCS620S rcs620s; // new int[] { 4Arduino RC-S620/S int waitCardReleased = 0; /* TagTechnology.NFC_F */}, // new Bundle[] { (OpenSource) int do_polling() } new Bundle() { });RC-S620/S rcs620s.timeout = COMMAND_TIMEOUT; final Intent i = new Intent(NfcAdapter.ACTION_TECH_DISCOVERED);   ret = rcs620s.polling(); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.putExtra(NfcAdapter.EXTRA_ID, idm); if (!ret) {return 0;} i.putExtra(NfcAdapter.EXTRA_TAG, tag); // idm can be read from rc620s.idm i.putExtra(NfcAdapter.EXTRA_NDEF_MESSAGES, msgs); return 1; return i; } }