3

I want to know if opening an RMS record checks it as modified in javame. For example

RecordStore rs;

//First RMS access 
rs.open("gamescores",true);
rs.addRecord(null,0,0);
rs.closeRecordStore;

//Second RMS access
rs = RecordStore.open("gamescores",true);
long timeStamp = rs.getLastModified();
rs.closeRecordStore();

would getLastModified() return the time of the first RMS access or of the second one.

Omoloro
  • 342
  • 1
  • 3
  • 9

2 Answers2

3

A different method is intended to track modifications of records - getVersion():

Each time a record store is modified (by addRecord, setRecord, or deleteRecord methods) its version is incremented. This can be used by MIDlets to quickly tell if anything has been modified. The initial version number is implementation dependent. The increment is a positive integer greater than 0. The version number increases only when the RecordStore is updated. The increment value need not be constant and may vary with each update.

As for getLastModified method, its specification doesn't allow to reliably tell the difference you're asking about in a portable way:

Returns the last time the record store was modified, in the format used by System.currentTimeMillis().

gnat
  • 6,213
  • 108
  • 53
  • 73
0

Up-till now i have never use this getLastModified() method so i google it and found and example. So yes the method returns the last modified time as in long format which you can easily convert into date.

Lucifer
  • 29,392
  • 25
  • 90
  • 143