Wants to create an record store in J2me Application as soon as the application starts

617 Views Asked by At

working on a j2me project... what i need to do is create a record store from a preexisting xml file (in d jar itself) so i can read and write data from it..... and wants to do this as sson as the application starts pls help.......

1

There are 1 best solutions below

1
On BEST ANSWER

write following code in startMIDlet() method

RecordStore recordStore = RecordStore.openRecordStore("recordstorename", true);
String data="data";
recordStore.addRecord(data.getBytes("UTF-8");, 0, data.getBytes().length);