Java tutorial
//package com.java2s; import java.io.FileOutputStream; import android.content.Context; import android.util.Log; public class Main { private static final String TAG = "CommonUtils"; public static void writeMediaListLastUpdatedTimeToFile(Context context, String listType, String lastUpdatedTime) { // writing to internal private memory FileOutputStream fos = null; try { fos = context.openFileOutput(listType, Context.MODE_PRIVATE); fos.write(lastUpdatedTime.getBytes()); fos.close(); Log.v(TAG, "Lastupdated time " + lastUpdatedTime + " successfully written to file for listType = " + listType); } catch (Exception exp) { Log.v(TAG, "Failed to write lastUpdated time. exp:" + exp.getMessage()); exp.printStackTrace(); } } }