Вопрос

I want to use RMS for storing Large Amount of Data. I have checked till certain Limit. I just want to ensure about RMS that will it capable to store it?

I have stored around 1,35,000 characters in RMS and I can also fetch them from RMS. How much data can I store using RMS?

I want to implement it in Live Application.

Это было полезно?

Решение

There is no such fixed limitation for RMS storage capacity. It all depends on how much free memory available on the device.

Try the following code snippet in your application to find memory status on device.

Runtime rt = Runtime.getRuntime();
long totalMemory = rt.totalMemory();
long freeMemory = rt.freeMemory();

// if rs is an instance of your App's RMS
// then, try
RecordStore rs = RecordStore.openRecordStore( "App_Db_Name_Here", true );
int sizeAvailable = rs.getSizeAvailable();
// it returns the amount of additional room (in bytes) available
// for this record store to grow.

Compare the above three values and proceed accordingly in your application.

But RMS IO operations would be slower as the size grows and hence such local database is not used for storing large data. Again this varies from device to device. You should be taking decision of implementation while porting your app on cross devices.

Refer to: RecordStore, and getSizeAvailable() documentation for complete notes.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top