How do I iterate through all recordstore for a j2me app?
The recordstore are created by the user when he enters some data.
So number of recordstore is not in my control.
So does the app keep track of all recordstore associated with a j2me app?
OR should I create a recordStore that will contain name of all other recordstores?
I can get all the row from a recordstore using
for(int i=1;i<=getnumrecords(RecordStoreName);i++)
RecordStoreName.getrecord(i);
But I am looking for such functionality for getting all the recordstore name associated with my app.
The reason I am creating a new RecordStore instead of a new row in one recordstore is because
the size of a recordstore in java me is limited by the phone.
So I have decided to create a new recordStore for every data I get from a form .
If your user can remove entries from a
RecordStoreyour loop will probably break because of anInvalidRecordIDExceptionon the call togetRecord.A safer approach to iterate the records is to use a
RecordEnumeration:Update after comments
You can use
staticmethodlistRecordStores. According to API: