Hi
I want to store a picture on my javacard.
Is there a way to do it ?
I think it will be easy if i put the byte[] on a file but i don t know if it s possible to creat a file in a javacard ?
could i have some help please ?
thanks

Storing an image in javacard is as simple as storing it in a byte array. The difficulty comes with any other requirements you have. With an image you will most likely need to add some kind of apdu command and response chaining.

First, thanks a lot for your answer i didn t know the interface ExtendedLengh but unfortunately
I have an error when i am trying to use the javacardx package
i have this error:
-------------------------------------------------------------------------------------------------------------
./helloWorldPackage/HelloWorldApplet.java:72: package javacardx.framework does not exist
import javacardx.framework.*;
^
1 error

thanks for all your answers
i have tested for -source 1.3 -target 1.3 -source 1.4 -target 1.4 -source 1.5 -target 1.5
but it s the same result , i still geting this error .
Realy i don t know if my javacard suport Extendedlengh , but i thing the best way to know is to test it with this applet .
For that, i need to know what is wrong with my comand line .
i forget to say something , i am using gpshell 1.4.4 , globalplatform 6.0.0 and javacard 2.2.2
Why my classpath (javacard 2.2.2) make error when i use javacardx ?

I don t know what i have done but it compile right now .
but even i emplement extendedLengh if i declare an array of byte bigger than 256 . i receave a statut different of 9000
maybe it s mean that my javacard are not compatible for extendedLengh ?
If someone have an idea to store a picture without using extendedLengh ?

safarmer you told me that APDU chaining would be more appropriate, but i don t understand how ?
my problem here is about to store a lot of byte . how could i do that with APDU chaining?
Thanks

i am running the applet on a card
when i have tried with your code , i get this error when i am trying to upload the applet on the card
//////////////////////////////////
Response <-- 6985
install_for_install_and_make_selectable() returns 0x80206985 (6985: Command not allowed - Conditions of use not satisfied.)
/////////////////////////////////

and when i replace
MAX_IMAGE_SIZE = 1024;
private byte[] imageFile = new byte[MAX_IMAGE_SIZE];
with
private byte[] imageFile = new byte[256];

it works (i can upload the applet) . So it s look like my javacard are not compatible .

I want to ask , is it possible to create a file on a card . i mean not using javacard applet just send specific apdu from the PC and store data on the card .
if it s possible can i have some help please ?

That seems strange. Can you create a byte[] that is 512 bytes? What happens if you create the byte array explicitly in your constructor?

>
I want to ask , is it possible to create a file on a card . i mean not using javacard applet just send specific apdu from the PC and store data on the card .
if it s possible can i have some help please ?
>

No. Without an applet you cannot perform any meaningful functions with Java Card. You would need to implement your own applet (or find one somewhere) that manages file system objects.

i tried to declare the byte array on the constructor but it s change anything .
So u told to me even if it s not a javacard i have to put an applet in the smartcard in the way to create a file .
so emv card are javacard because he store data on some files on the card ?

i tried to declare the byte array on the constructor but it s change anything .

Either you are out of space or there is something strange happening that I would not expect.

So u told to me even if it s not a javacard i have to put an applet in the smartcard in the way to create a file .

Sorry, I must have misread your post. You need to have an applet on a Java Card based card to store files. If you have a native ISO7816 file system card or something like a mifare card then you can store files or blocks of data.

so emv card are javacard because he store data on some files on the card ?

EMV cards may be Java Card based as you can implement the payment specifications in an applet, or it could be native (C/Assembly).