How can I retrieve data stored using MIDP's RMS? I would like to collect some data in the handset and then be able to process it in the PC's application.
If I can't do it using RMS, is there a way to store data in text files using MIDP?
How can I retrieve data stored using MIDP's RMS? I would like to collect some data in the handset and then be able to process it in the PC's application.
If I can't do it using RMS, is there a way to store data in text files using MIDP?
You can programmatically retrieve data from RMS and send it to server with a network call, and thus to a PC application. Some handsets implement the JSR 75 (javax.microedition.io.file) for file system access, not all. You can use it to read and write text files. However I think sending the data over a HTTP connection is the easiest way to do this.
HTTP is the way to go - but if you are looking at doing this with multiple devices you will run into different problems.
Sending a little data should be simple you build a HTTP GET request and just put your data in the url - however there is a limit to the length of urls - sometimes this is restricted by device, or by the network that you are using the device on - and sometimes by the server at the other end.
We have found the best way to send up data is to send it up in batches and multiple HTTP POST requests - which gets around any proxy servers that might be in the way. We use JSON to send data as it is very lightweight.
We did have success using the HTTP method to attach a file to a request - but soon found out this was limited to certain devices and networks.
If this is all just for personal use - then just do what works - but for an application you want others to use I can only recommend HTTP POST and in small batches (2K say).
I'd go for JSR 75. It is not actually quite true that it is supported in a limited number of phones, almost all modern phones which don't belong to low-end category support this API.
And using JSR 75 you accomplish the task much simpler. You don't even need to use Internet, you just save a file in phone memory (or on a memory card), then retrieve it from PC.
On some models (I know for sure for BenQ/Siemens ones) it is possible to copy the raw RecordStore file over from the real device to the emulator. And the emulator writes all stdout/stderr text to a file. I used this once to extract larger amounts of data from a RMS. But using File APIs (if the model supports them) is easier of course.