使用设备:MX3, 魅蓝note
1.nfc手机使用Open Mobile API访问到的是内置的nfc的SE?如何才能访问sim卡上的SE?
调用: Open Mobile API
1.nfc手机使用Open Mobile API访问到的是内置的nfc的SE?如何才能访问sim卡上的SE?
使用MX3访问nfc-sim卡时,访问到的是内置的SE,没有显示可访问sim卡的SE。按照Open Mobile API的使用规范以及在网上的一些资料:http://blog.csdn.net/menghnhhuan/article/details/16940197,在创建,继承,实现接口之后,访问SE。在调用SEService.getReaders()时,不论手机是否插上了nfc-SIM卡,得到的readers数目始终是1。也就是说,手机只能访问到手机内部的SE,对nfc-sim卡中的SE始终“视而不见”。代码如下:(参考网上资料)
package com.example.test;
import org.simalliance.openmobileapi.Channel;
import org.simalliance.openmobileapi.Reader;
import org.simalliance.openmobileapi.SEService;
import org.simalliance.openmobileapi.Session;
import android.nfc.NfcAdapter;
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.widget.TextView;
public class MainActivity extends Activity implements SEService.CallBack {
final String LOG_TAG = "HelloSmartcard";
/**
* API entry point
*/
private SEService seService;
NfcAdapter mNfc;
TextView mTextView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mNfc = NfcAdapter.getDefaultAdapt