stelian42 / HarleyDroid

Harley Davidson J1850 Data Analyser for Android
https://github.com/stelian42/HarleyDroid/wiki/HarleyDroid-!
GNU General Public License v3.0
33 stars 17 forks source link

Log File Crc Err: Fixed #6

Closed kenrox closed 10 years ago

kenrox commented 13 years ago

first of all, if you do not have the bluetooth bug. it's impossible to crash harley droid. it's well written. but for the log files. a simple routine change will make the files properly record and close it self for analysis. it's not about harley droid itself crashing but about not closing the files properly. just add: path.mkdirs(); if(mLog!=null) { mLog.close(); mLog=null; }

the original source. try { File path = new File(Environment.getExternalStorageDirectory(), "/Android/data/org.harleydroid/files/");

        path.mkdirs();

(in here) File logFile = new File(path, "harley-" + TIMESTAMP_FORMAT.format(new Date()) + ".log.gz"); mLog = new GZIPOutputStream(new FileOutputStream(logFile, false));

problem solved! :D

stelian42 commented 12 years ago

HarleyDroid's code has changed a lot since this bug report, which is probably not relevant anymore...

Will close the bug when releasing v2.0, which should happen real soon now.