views:

90

answers:

0

I'm writing a Java ME app and I'd like to determine if a smart card is connected.

The JCRMI interface ( http://java.sun.com/javame/reference/apis/jsr177/ ) defines this connection, but near as I can tell you need to have a specific application address to create the connection.

The spec says the Connection.open url must be "jcrmi:"[slot]";AID:"[cardApplicationAddress]

I don't have an address, I just want to see if the card is inserted. I tried 0.0... but that failed. Connection.open throws the same exception for invalid slot/no card/invalid app id, so I can't make the determination based on what error is thrown.

There is a System.getProperty() that retrieves valid slots, but nothing indicates if they're in use.