protected static String makeDebugDir(File root,String folderName){
  if (root == null) {
    return null;
  }
  if (!root.exists() || !root.isDirectory()) {
    throw new RuntimeException("Gcam debug directory not valid or doesn't exist: " + root.getAbsolutePath());
  }
  String serialSubstring="";
  String serial=android.os.Build.SERIAL;
  if (serial != null) {
    int length=serial.length();
    if (length > DEBUG_FOLDER_SERIAL_LENGTH) {
      serialSubstring=serial.substring(length - DEBUG_FOLDER_SERIAL_LENGTH,length);
    }
 else {
      serialSubstring=serial;
    }
  }
  SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyyMMdd_HHmmss_SSS");
  simpleDateFormat.setTimeZone(TimeZone.getDefault());
  String currentDateAndTime=simpleDateFormat.format(new Date());
  String burstFolderName=String.format("%s_%s",serialSubstring,currentDateAndTime);
  File destFolder=new File(new File(root,folderName),burstFolderName);
  if (!destFolder.mkdirs()) {
    throw new RuntimeException("Could not create Gcam debug data folder.");
  }
  String destFolderPath=destFolder.getAbsolutePath();
  return destFolderPath;
}

protected static String makeDebugDir ( File root , String folderName ) { if ( root == null ) { return null ; } if ( ! root . exists ( ) || ! root . isDirectory ( ) ) { throw new RuntimeException ( "Gcam debug directory not valid or doesn't exist: " + root . getAbsolutePath ( ) ) ; } String serialSubstring = "" ; String serial = android . os . Build . SERIAL ; if ( serial != null ) { int length = serial . length ( ) ; if ( length > DEBUG_FOLDER_SERIAL_LENGTH ) { serialSubstring = serial . substring ( length - DEBUG_FOLDER_SERIAL_LENGTH , length ) ; } else { serialSubstring = serial ; } } SimpleDateFormat simpleDateFormat = new SimpleDateFormat ( "yyyyMMdd_HHmmss_SSS" ) ; simpleDateFormat . setTimeZone ( TimeZone . getDefault ( ) ) ; String currentDateAndTime = simpleDateFormat . format ( new Date ( ) ) ; String burstFolderName = String . format ( "%s_%s" , serialSubstring , currentDateAndTime ) ; File destFolder = new File ( new File ( root , folderName ) , burstFolderName ) ; if ( ! destFolder . mkdirs ( ) ) { throw new RuntimeException ( "Could not create Gcam debug data folder." ) ; } String destFolderPath = destFolder . getAbsolutePath ( ) ; return destFolderPath ; }
create a directory we can use to store debugging information during gcam captures . < br / > the directory created is [ root ] / [ foldername ] / ssss_yyyymmdd_hhmmss_xxx , where ' ssss ' are the last ' debug_folder_serial_length ' digits of the devices serial number , and ' xxx ' are milliseconds of the timestamp .
