Use new log system

This commit is contained in:
fkloft
2014-01-05 19:16:46 +01:00
parent b31d973cff
commit 5d674eee40
15 changed files with 84 additions and 50 deletions

View File

@ -51,7 +51,7 @@ public class CheckHttpResponse extends AsyncTask<String, Void, Boolean> {
}
}
} catch (IOException e) {
e.printStackTrace();
Log.w(e);
}
return false;
}

View File

@ -35,16 +35,12 @@ public class DownloadTile extends AsyncTask<String, Void, Boolean> {
Log.d("writing to file: " + file.toString());
writeTileToFile(is, file);
} catch (IOException e) {
e.printStackTrace();
return false;
} catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
}
private void writeTileToFile(InputStream inStream, File file) throws Exception {
private void writeTileToFile(InputStream inStream, File file) throws IOException {
file.getParentFile().mkdirs();
FileOutputStream outStream = new FileOutputStream(file);
int bufferSize = 1024;
@ -53,7 +49,7 @@ public class DownloadTile extends AsyncTask<String, Void, Boolean> {
while ((len = inStream.read(buffer)) != -1) {
outStream.write(buffer, 0, len);
}
if(outStream!=null) outStream.close();
if (outStream != null)
outStream.close();
}
}

View File

@ -2,6 +2,8 @@ package com.cradle.iitc_mobile.async;
import android.os.AsyncTask;
import com.cradle.iitc_mobile.Log;
import java.io.IOException;
import java.net.URL;
import java.util.Scanner;
@ -21,7 +23,7 @@ public class UrlContentToString extends AsyncTask<URL, Integer, String> {
js = new Scanner(url.openStream(), "UTF-8").useDelimiter("\\A")
.next();
} catch (IOException e) {
e.printStackTrace();
Log.w(e);
}
return js;
}