importjavax.microedition.rms.RecordListener;importjavax.microedition.rms.RecordStore;importjavax.microedition.rms.RecordStoreException;/**
* Just another useless thing we don't ever use
* @author Ethicist
*/publicclassDatabaseLoggerimplementsRecordListener{privateApplicationapp=newApplication();publicvoidrecordAdded(RecordStorerecordstore,intid){try{System.out.println("Added record: "+id+"\n");}catch(Exceptionerror){Stringerr="An error occured while adding record:"+"\n";Stringmsg=error.getMessage()+"\n"+error.toString();System.out.println(err+msg+"\n");app.display.setCurrent(app.getAlert(err+msg,2));error.printStackTrace();}}publicvoidrecordDeleted(RecordStorerecordstore,intid){try{System.out.println("Deleted record: "+id+"\n");}catch(Exceptionerror){Stringerr="An error occured while removing record:"+"\n";Stringmsg=error.getMessage()+"\n"+error.toString();System.out.println(err+msg+"\n");app.display.setCurrent(app.getAlert(err+msg,2));error.printStackTrace();}}publicvoidrecordChanged(RecordStorerecordstore,intid){try{System.out.println("Changed record: "+id+"\n");}catch(Exceptionerror){Stringerr="An error occured while changing record:"+"\n";Stringmsg=error.getMessage()+"\n"+error.toString();System.out.println(err+msg+"\n");app.display.setCurrent(app.getAlert(err+msg,2));error.printStackTrace();}}publicvoiddisplayRecordStoreinfo()throwsRecordStoreException{RecordStorers=app.mplayer.settings.database.getRecordStore();if(rs==null){try{// TODO: This information must be added to separated menurs=RecordStore.openRecordStore("preferences",true);}catch(RecordStoreExceptionex){ex.printStackTrace();}}try{System.out.println("Database name: "+rs.getName());System.out.println("Total records: "+rs.getNumRecords());System.out.println("Database size: "+rs.getSize());System.out.println("Available size:"+rs.getSizeAvailable());System.out.println("Database version:"+rs.getVersion());System.out.println("Last Modified: "+rs.getLastModified());}catch(Exceptionerror){Stringerr="An error occured while displaying DB info:"+"\n";Stringmsg=error.getMessage()+"\n"+error.toString();System.out.println(err+msg+"\n");app.display.setCurrent(app.getAlert(err+msg,2));error.printStackTrace();}}}