How do I get a bitmap image from InputStream(base64 String)
in Android?
Below is my code:
protected Bitmap doInBackground(Void... params) {
Bitmap image;
URL url1 = null;
try {
url1 = new URL("http://sunnyfacemash.atwebpages.com/get.php"); // url
} catch (MalformedURLException e) {
e.printStackTrace();
}
try {
image = BitmapFactory.decodeStream(url1.openConnection().getInputStream());
return image;
} catch (IOException e) {
image = null;
e.printStackTrace();
}
return image;
}