Java Card Applet APDUs for string, decimal, integer and jpeg file ?

Dear friends,

I am a beginner in Java Card Applet, and now I'm going to create a Java Card Applet for specific purpose,

I'm using Eclipse 3.2.0, JCOP Tools 3.1.2, Java Card SDK 2.2.1..

so far I learn from classic wallet.java....

I have some questions :

=================

1. In wallet.java, in private void getBalance (APDU apdu) procedure there are codes :

buffer [0] = (byte) (balance >> 8);

buffer [1] = (byte) (balance & 0xFF);

why we use balance >> 8

?

Why we use balance & 0xFF

?

if for example, we have 12 bytes data, how we declare it ? And should we declare it like this buffer [0], buffer [1]..until buffer [11]

2.

For example, we get an SQL data such as Name (string), Grade (decimal), Image (Jpeg file), Value (integer)

how we should make the APDU format ?

3.

Do you know extensive site/link on this Java Card Applet and related tools ?

Thank you,

hendy

[1072 byte] By [hhanusina] at [2007-11-27 11:24:27]
# 1

>if for example, we have 12 bytes data, how we declare it ? And should we >declare it like this buffer [0], buffer [1]..until buffer [11]

byte[] buffer = new byte[12];

Then you simply store the bytes by addressing buffer[0], buffer[1] and so on in turn (as you say).

>For example, we get an SQL data such as Name (string), Grade (decimal), >Image (Jpeg file), Value (integer)

>how we should make the APDU format ?

That is fully up to yourselves to decide - there is no one static way to solve this.

>Do you know extensive site/link on this Java Card Applet and related tools ?

http://developers.sun.com/mobility/javacard/articles/javacard1/ provides a good intro to Java Card development. Zhiqun Chen's book Java Card technology for Smart Cards - Architecture and Programmer's Guide is also a good starting point.

Good luck!

Lillesanda at 2007-7-29 15:58:23 > top of Java-index,Java Mobility Forums,Consumer and Commerce...