0

This sounds weird, I know.

I am developing an Android app using NFC, the app reads a tag from a samrtcard using IsoDep APDU commands, everything usually works but sometimes it fails, and keep on failing in the followed executions, when it fails it occurs when connecting the tag, the tag has its "mConnectedValue = -1", which means no technology connected but the followed code is executed

    card = IsoDep.get(tag);
    card.setTimeout(20000);
    card.connect();

connect() throws ans excepcion, the exception is catch by this code:

        } catch (IOException e) {
            ...
        }

If "e" is inspected with eclipse shows e=null, but the code inside the catch is executed, anyone can explain why e=null? The code above is inside a loop, and followed executions keep on returning that "exception" e=null.

Thank you very much!

4

1 に答える 1

0

修正されました。実際には「e=null」は同じままです。「IOExceptione=null」がスローされることもあれば、「e = null」がスローされることもあります。どちらの場合も、エラーは同じコードでキャッチされます。バグの。

また、接続の問題も解決しました。デバイスの障害であり、チップはスマートカードにエネルギーを供給するのに十分なほど強力ではありませんでした。読み取りと書き込みは問題ありませんでしたが、カードが操作を行うと、電話を動かすだけでは不十分です。少し上向きに問題を解決しました。

ありがとう!

于 2013-03-08T11:45:52.480 に答える