create Picture File Path - Android Media

Android examples for Media:Picture

Description

create Picture File Path

Demo Code


import java.io.File;

import android.os.Environment;
import android.text.format.DateFormat;

public class Main {
  public static final String DATE_FORMAT = "yyyy-MM-dd_kk.mm.ss";
  public static final String DIR_SAVE_PICS = Environment
      .getExternalStorageDirectory().toString() + "/CTW";

  public static String createPictureFilePath() {
    String filename = DateFormat
        .format(DATE_FORMAT, System.currentTimeMillis()).toString();
    return DIR_SAVE_PICS + File.separator + filename + ".JPG";
  }/*from   w w w.ja v a2  s. com*/
}

Related Tutorials