I am using Asynctask to download a image from internet.
I want to save this image to internal storage and later I want to use this image.
I can download successfully but I cant find internal storage path where it is storing.
This DownloadImages.java
private class DownloadImages extends AsyncTask<String,Void,Bitmap> {
private Bitmap DownloadImageBitmap(){
HttpURLConnection connection = null;
InputStream is = null;
try {
URL get_url = new URL("http://www.medyasef.com/wp-content/themes/medyasef/images/altlogo.png");
connection = (HttpURLConnection) get_url.openConnection();
connection.setDoInput(true);
connection.setDoOutput(true);
connection.connect();
is = new BufferedInputStream(connection.getInputStream());
final Bitmap bitmap = BitmapFactory.decodeStream(is);
// ??????????
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
finally {
connection.disconnect();
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return null;
}
@Override
protected Bitmap doInBackground(String... params) {
return DownloadImageBitmap();
}
}
Any help will be appreciated. :)
Thank you.