Search code examples
javajava-merecordstore

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


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.......


Solution

  • 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);