File writeHockeyAppCrashLog(String stackTrace){
  File logFile=null;
  BufferedWriter writer;
  try {
    File outputDir=context.getCacheDir();
    logFile=File.createTempFile("hockey_app_crash_",".log",outputDir);
    writer=new BufferedWriter(new FileWriter(logFile));
    writer.write("Package: " + utils.getApplicationPackageName(context) + "\n");
    writer.write("Version Code: " + utils.getVersionCode(context) + "\n");
    writer.write("Version Name: " + utils.getVersionName(context) + "\n");
    writer.write("Android: " + Build.VERSION.RELEASE + "\n");
    writer.write("Manufacturer: " + Build.MANUFACTURER + "\n");
    writer.write("Model: " + Build.MODEL + "\n");
    writer.write("Date: " + getTimestamp() + "\n");
    writer.write("\n");
    writer.write(stackTrace);
    writer.close();
  }
 catch (  Exception ex) {
    utils.logIssue("Error writing crash report to temp log file",ex);
  }
  return logFile;
}

File writeHockeyAppCrashLog ( String stackTrace ) { File logFile = null ; BufferedWriter writer ; try { File outputDir = context . getCacheDir ( ) ; logFile = File . createTempFile ( "hockey_app_crash_" , ".log" , outputDir ) ; writer = new BufferedWriter ( new FileWriter ( logFile ) ) ; writer . write ( "Package: " + utils . getApplicationPackageName ( context ) + "\n" ) ; writer . write ( "Version Code: " + utils . getVersionCode ( context ) + "\n" ) ; writer . write ( "Version Name: " + utils . getVersionName ( context ) + "\n" ) ; writer . write ( "Android: " + Build . VERSION . RELEASE + "\n" ) ; writer . write ( "Manufacturer: " + Build . MANUFACTURER + "\n" ) ; writer . write ( "Model: " + Build . MODEL + "\n" ) ; writer . write ( "Date: " + getTimestamp ( ) + "\n" ) ; writer . write ( "\n" ) ; writer . write ( stackTrace ) ; writer . close ( ) ; } catch ( Exception ex ) { utils . logIssue ( "Error writing crash report to temp log file" , ex ) ; } return logFile ; }
write log file in format expected by hockey app . see http : / / support . hockeyapp . net / kb / api / api - crashes # post - custom - crashes
