After I installed an application to my phone, and the application contains a RMS. When I run this application, it can save my highest score.
However, after I closed my application, all data (record) will be lost.
Does it is possible to make a permanent database in the application?
Thanks a lot!
My RMS to open a database is:
public static RecordStore openRSAnyway (String rsname)
{
RecordStore rs = null;
if(rsname.length()>32)
return null;
try {
rs = RecordStore.openRecordStore(rsname, true);
return rs;
} catch (Exception e)
{
return null;
}
}
public static RecordStore openRSExisted(String rsname)
{
RecordStore rs = null;
if (rsname.length()>32)
return null;
try {
rs = RecordStore.openRecordStore(rsname, false);
return rs;
} catch (Exception e)
{
return null;
}
}
public static int writeInt2RS(RecordStore rs, int data)
{
byte []tmp = new byte[4];
tmp[0] = (byte)(0xff&(data>>24));
tmp[1] = (byte)(0xff&(data>>16));
tmp[2] = (byte)(0xff&(data>>8));
tmp[3] = (byte)(0xff&(data>>0));
try
{
return rs.addRecord(tmp, 0, tmp.length);
} catch(Exception e)
{
}
return -1;
}