本文整理汇总了Java中android.nfc.tech.NfcV类的典型用法代码示例。如果您正苦于以下问题:Java NfcV类的具体用法?Java NfcV怎么用?Java NfcV使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NfcV类属于android.nfc.tech包,在下文中一共展示了NfcV类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolveIntent
import android.nfc.tech.NfcV; //导入依赖的package包/类
private void resolveIntent(Intent data, boolean foregroundDispatch) {
this.setIntent(data);
scan = true;
String action = data.getAction();
if ((data.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) != 0) { return; }
if (NfcAdapter.ACTION_TECH_DISCOVERED.equals(action)){
Tag tag = data.getParcelableExtra(NfcAdapter.EXTRA_TAG);
Date now = new Date();
if (foregroundDispatch && (now.getTime() - last_scan.getTime()) > 10000) { //10000 = 10sec
String[] techList = tag.getTechList();
String searchedTech = NfcV.class.getName();
// ###################### read Tag ######################
ProgressBar pb_scan;
pb_scan = (ProgressBar)findViewById(R.id.pb_reading_spin);
pb_scan.setVisibility(View.VISIBLE);
new NfcVReaderTask(this).execute(tag);
// ######################################################
}
}
}
示例2: setForegroundListener
import android.nfc.tech.NfcV; //导入依赖的package包/类
private void setForegroundListener() {
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
boolean handleFormatable = preferences.getBoolean("format_ndef_formatable_tags", false);
pi = PendingIntent.getActivity(this, 0, new Intent(this,getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);
intentFiltersArray = null;
if(handleFormatable)
techList = new String[][]{ new String[]{ NfcA.class.getName(),Ndef.class.getName()},
new String[]{ NfcB.class.getName(),Ndef.class.getName()},
new String[]{ NfcF.class.getName(),Ndef.class.getName()},
new String[]{ NfcV.class.getName(),Ndef.class.getName()},
new String[]{ NfcA.class.getName(),NdefFormatable.class.getName()},
new String[]{ NfcB.class.getName(),NdefFormatable.class.getName()},
new String[]{ NfcF.class.getName(),NdefFormatable.class.getName()},
new String[]{ NfcV.class.getName(),NdefFormatable.class.getName()}};
else
techList = new String[][]{ new String[]{ NfcA.class.getName(),Ndef.class.getName()},
new String[]{ NfcB.class.getName(),Ndef.class.getName()},
new String[]{ NfcF.class.getName(),Ndef.class.getName()},
new String[]{ NfcV.class.getName(),Ndef.class.getName()}};
}
示例3: handleIntent
import android.nfc.tech.NfcV; //导入依赖的package包/类
private void handleIntent(Intent intent) {
String action = intent.getAction();
if (NfcAdapter.ACTION_TECH_DISCOVERED.equals(action)) {
Log.d("socialdiabetes", "NfcAdapter.ACTION_TECH_DISCOVERED");
// In case we would still use the Tech Discovered Intent
Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
String[] techList = tag.getTechList();
String searchedTech = NfcV.class.getName();
new NfcVReaderTask().execute(tag);
}
}
示例4: ISO15693Tag
import android.nfc.tech.NfcV; //导入依赖的package包/类
/**
* コンストラクタ
*
* @param nfcTag NFCTagへの参照をセット
*/
public ISO15693Tag(Tag nfcTag) {
mNfcTag = nfcTag;
NfcV nfcV = NfcV.get(mNfcTag);
mDsfId = nfcV.getDsfId();
mUID = new UID(mNfcTag.getId());
}
示例5: NfcIso15693
import android.nfc.tech.NfcV; //导入依赖的package包/类
public NfcIso15693(Tag tag) {
nfcv = NfcV.get(tag);
uid = tag.getId();
maxTranscieveLength = nfcv.getMaxTransceiveLength();
}
示例6: load
import android.nfc.tech.NfcV; //导入依赖的package包/类
public static String load(Parcelable parcelable, Resources res) {
final Tag tag = (Tag) parcelable;
final IsoDep isodep = IsoDep.get(tag);
Log.d("NFCTAG", "ffff");//isodep.transceive("45".getBytes()).toString());
if (isodep != null) {
return PbocCard.load(isodep, res);
}
final NfcV nfcv = NfcV.get(tag);
if (nfcv != null) {
return VicinityCard.load(nfcv, res);
}
final NfcF nfcf = NfcF.get(tag);
if (nfcf != null) {
return OctopusCard.load(nfcf, res);
}
return null;
}