-1

I make a j2me application work properly, but I want to delete the RMS file after same day like the file created in 3-3-2012 and delete automatically the 10-3-2012 file.

Please help me with suggestions on how to delete the RMS file using j2me program. It is not required to delete the record; I want the delete the RMS file.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

1 Answers1

1

use this method to delete an RMS file from device:

/**
 * A static method to delete a particular storage file
 * @param storageName Name of existing storage file
 * @return True if deleted, else False
 */
public static boolean DeleteStorage(String storageName){
    boolean isDeleted = false;

    try{
        RecordStore.deleteRecordStore(storageName);
        isDeleted = true;
    }
    catch(RecordStoreException ex){ isDeleted=false; }

    return isDeleted;
}
waqaslam
  • 67,549
  • 16
  • 165
  • 178