SerME is very simple serialization and persistence library. It is intended to be used at J2ME (MIDP 1.0 and MIDP 2.0) which is not providing reflection and serialization capabilities. SerMe is able to store data using two APIs: first - RMS (javax.miroedition.rms) is standard for J2ME an dincluded in MIDP 1.0, second - using files, which are supported by javax.miroedition.io.file package which is optional package for MIDP 2.0 implemented mostly on smartphones and PDA devices.
So i used SERME & save the data on RMS with the help of SERME i am able to store the HASHTABLE into the RMS & if i want to retrieve data from RMS it will return the Hashtable So it gives lots of advantages according to my needs .
If i just want to store the Data on RMS by using SERME here is the Code:
RmsStorage storage=new RmsStorage("Customer");//Customer is the file that create on RMSIf i want to retrieve my Data from RMS usning SERME here is the code:
storage.create();//Here we create the File
HashTable dump=new HashTable();
dump.add(new Integer(1),customerclassobject);
storage.setRoot(dump);//Set the root object of the database
storage.close();//close the database
RmsStorage storage=new RmsStorage("Customer");//Customer is the file that create on RMS
storage.create();//Here we create the File
HashTable dump=new HashTable();
dump=storage.getRoot();//Get the Root object from the Storage
storage.close();//close the database
ISSUES
The issues i face for using SERME is that it will not provide any tutorial & not found any stuff in internet to how to use it there is only some examples int the serme website that will give me some help so that' s why i share this read data & write data code .
There is a issue with serme that when we write the Class Object in HashTable in & save it in RMS using SERME .But next time when i read the HashTable from the RMS & get the object from HashTable it will give the
Error :"abcclass not found"*abcclass is the class that's object i store on the hashtable.
The problem is that when j2me application run it obfuscate the class name so when we try read our database so it will threw an exception .So the solution is that
keep class="com.packagename.abcclass"
ADD the following Line in the build.xml