2012-04-04 17 views
0

我需要與智能手機上的SIM卡交換APDU。net.rim.device.api.smartcad.SmartCardNoCardPresentException當調用SmartCardReader.openSession()

我做了一個小測試功能,使用我的運營商的(羅傑斯)SIM卡來嘗試這個功能。

SmartCardReader[] allReaders = SmartCardReaderFactory.getInstalledReaders(); 
for(int readerIndex = 0; readerIndex < allReaders.length; ++readerIndex) { 
    try { 
     SmartCardReaderSession session = allReaders[readerIndex].openSession(); 
    } 
    catch(Exception e) { 
     System.err.println(e.toString()); 
    } 
} 

但我不斷收到SmartCardNoCardPresentException異常。

顯然,SIM卡存在(我可以用它來撥打電話),但isSmartCardPresent()返回false。

請注意,我沒有在模擬器上運行它,它只在真實手機上「運行」。我使用Torch 9810作爲目標。

另請注意,我已經簽署了我的申請。

任何提示/建議,將不勝感激。

回答

1

我認爲這是對黑莓智能卡讀卡器概念的誤解。

你猜這個SIM卡是一個智能卡,並且安裝的SIM卡必須被識別爲一個智能卡。但事實並非如此。

更多此處瞭解:Smart card reader for BlackBerry