1

I am new in J2ME. In my Application, I have to store a large amount of data in Database and have to access it. But with the limitation of RMS in J2ME, I can't store large amount of data.

Is there any way to access database file from External Storage(SD card)?

gnat
  • 6,213
  • 108
  • 53
  • 73
Karan
  • 165
  • 11

2 Answers2

2

I am partially agree with funkybro, i.e. you can not save your RMS in to SDCard.

You can also use Files to store your data. but should be last option.

Here i am suggesting you an another option, i.e. install your application on SD-Card and then user. This way your RMS will be created on Memory card, so no space issue will arise. But the problem you may face shall be if you are using this application on s40 Series device then your heap memory will be limited to 2MB. Your application may crash during execution. If you are using s60 series device, it will work fine.

I also want you to look at my this answer for more information.

Community
  • 1
  • 1
Lucifer
  • 29,392
  • 25
  • 90
  • 143
  • There's absolutely no guarantee installing the app on SD card will cause RMS to be created on SD card too! – funkybro Jul 23 '12 at 13:22
  • @funkybro, full 100% gurantee, because RMS gets creates on the same folder where midlet gets installed, i have checked this personally – Lucifer Jul 23 '12 at 14:18
  • I don't believe you have checked this on all Java ME devices in existence. There is such a wide variety of implementations, and nowhere is it mandated that RMS is created on the same storage device as the MIDlet is installed. On many devices there is no concept of the MIDlet being installed in a folder. – funkybro Jul 23 '12 at 14:25
  • @funkybro of course, i can't check on all the Java ME devices, but i have checked it on Nokia 3500c , s40 Series phone, – Lucifer Jul 23 '12 at 14:30
  • Nowhere does the OP say they are using S40! The advice in your answer is anecdotal and by no means guaranteed to be correct in all cases. – funkybro Jul 23 '12 at 14:38
1

If you are really asking "can I make RMS save to the SD card", the answer is NO you have no control over where the device persists RMS data.

You would need to use JSR-75 to save data on the SD card in your own format.

funkybro
  • 8,432
  • 6
  • 39
  • 52
  • how can i use JSR-75 on netbeans IDE 7.1.2 and how can i access it on emulator? – Karan Jul 23 '12 at 10:20
  • Search online for JSR-75 introduction. However if it's up to 1MB as you say above, you probably won't have too much of a problem on most devices. Have you actually tried it and run in to problems? – funkybro Jul 23 '12 at 10:44
  • Don't you think it would be difficult to run with 1MB, while having heap memory size only MB ? – Lucifer Jul 23 '12 at 11:14
  • @Lucifer the only way to find out is to try, and then resort to other solutions if it fails... – funkybro Jul 23 '12 at 13:20