문제

As the HCE was implemented in the version 4.4, I could not find information of how to write in an emulated card.

The android website has a sample of card emulation and a sample of to read the card, but I could not find information about the possibility of writing in a emulated card and how to do it.

I am developing a application that will read an emulated card, it will modify the card and write it again.

Someone know if it's possible and how can I do it?

도움이 되었습니까?

해결책

The question "How [do I] write in a [Android HCE] emulated card?" does not really match the concept of Android HCE.

With Android HCE you do not emulate a memory card, hence there is no such thing as writing to/reading from such an emulated card by default. Instead, you emulate an APDU based smartcard application (note: application, not memory area, not whole card). APDUs are commands that you can send to a card (for instance with a PC/SC-compliant contactless smartcard reader). These commands are then interpreted by your emulated smartcard application (i.e. your HCE service) and used to generate response messages.

So, to summarize, you define the commands (based on ISO 7816-4 APDU structure) that your application should understand and the response message format (again based on ISO 7816-4 APDU structure) that your application sends back.

다른 팁

There are some ISO 7816-4 based commands listed in this link:

http://www.cardwerk.com/smartcards/smartcard_standard_ISO7816-4_6_basic_interindustry_commands.aspx

I've based my communication is this commands, mainly in the item 6.6.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top