I'm attempting to obtain an image URL through JSON data, which works successfully. Everything below works SLOWLY. However, I am trying to figure out a way to get a URL to display much faster below in Android Volley or another fast method. I am trying to download these images from a URL (resized too) into a MapView
pin icon. If there is a more efficient example anyone can find, I am all in. Please let me know if you need more information from me. I am following this guide: Android load from URL to Bitmap
final String profilePicture = profilePic;
URL url = new URL(profilePicture);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setDoInput(true);
conn.connect();
InputStream is = conn.getInputStream();
Bitmap bit = BitmapFactory.decodeStream(is);
Bitmap b = Bitmap.createScaledBitmap(bit, 100, 100, false);
ByteArrayOutputStream out = new ByteArrayOutputStream();
b.compress(Bitmap.CompressFormat.JPEG, 10, out);
Bitmap decoded = BitmapFactory.decodeStream(new ByteArrayInputStream(out.toByteArray()));
bitmapDescriptor = BitmapDescriptorFactory.fromBitmap(decoded);