简体   繁体   中英

Write in a emulated card Android HCE (Host card Emulation)

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 (ie 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM