本文整理汇总了Java中android.nfc.tech.NfcA.get方法的典型用法代码示例。如果您正苦于以下问题:Java NfcA.get方法的具体用法?Java NfcA.get怎么用?Java NfcA.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.nfc.tech.NfcA
的用法示例。
在下文中一共展示了NfcA.get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onNewIntent
import android.nfc.tech.NfcA; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
protected void onNewIntent(Intent paramIntent) {
if (NfcAdapter.ACTION_TAG_DISCOVERED.equals(paramIntent.getAction())) {
Tag tag = paramIntent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
byte[] uid = paramIntent.getByteArrayExtra(NfcAdapter.EXTRA_ID);
NfcA ntag215 = NfcA.get(tag);
if (_stack_controller != null) {
PopableFragment popable = _stack_controller.head();
if (popable != null) {
if (popable instanceof ScanFragment) {
((ScanFragment) popable).tryReadingAmiibo(ntag215, uid);
} else if (popable instanceof ScanToWriteFragment) {
((ScanToWriteFragment) popable).tryWriteAmiibo(ntag215, uid);
}
}
}
} else {
setIntent(paramIntent);
}
}
示例2: onTagDiscovered
import android.nfc.tech.NfcA; //导入方法依赖的package包/类
@Override
public void onTagDiscovered(Tag tag) {
remoteTag = NfcA.get(tag);
try {
String str = readUID();
LocalBroadcastManager.getInstance(mContext).sendBroadcast(new Intent("tag-detected"));
} catch (Exception e) {
LocalBroadcastManager.getInstance(mContext).sendBroadcast(new Intent("error"));
}
}
示例3: handle
import android.nfc.tech.NfcA; //导入方法依赖的package包/类
@Override
public Element handle(Tag tag) {
NfcA nfca = NfcA.get(tag);
List<AbstractElement> elements = new LinkedList<AbstractElement>();
elements.add(TextElement.keyValueFrom("sak", "SAK/SEL_RES", Short.toString(nfca.getSak())));
elements.add(TextElement.keyValueFrom("atqa", "ATQA/SENS_RES",
SharedStringUtil.byteToHexString(nfca.getAtqa())));
Element element = new Element("nfca_tech", "NFC-A (ISO 14443-3A) Technology Information");
element.addChildElements(elements);
return element;
}
示例4: NfcNtag
import android.nfc.tech.NfcA; //导入方法依赖的package包/类
public NfcNtag(Tag tag) {
nfca = NfcA.get(tag);
maxTransceiveLength = nfca.getMaxTransceiveLength();
}