Download images from server whenever it required in j2me

266 views Asked by At

I have one canvas where I am showing 5 images in sequence (in sliding). Actually I am getting only 5 images for download that time mobile device not showing out of memory error but when I am going to download 20 images for sliding that time it is showing error out of memory. I want to implement one thing here: whenever I am moving images on canvas that time I want to download only that five images which is showing on canvas not others. But how to do this task on run time of canvas I don't know.

I am looking for some idea how to do this task?

1

There are 1 answers

0
SIVAKUMAR.J On

For j2me,the heap size is upto 1 to 2 MB.So u download a each image after downloading store in a file.Do not store in application memory.When u want the images read it from file.20 images means large amount of memory is needed (some times it exceeds the heap memory size).So better u store it in a seperate file and not store in application memory.When u want then read it from "FileConnection" API.