I\'m writing an application that works alot with google map and markers on it. My task is to create and display some amount of markers on google map. Markers have custom ima
Use Picasso , Glide or Fresco Literary to cache bitmaps efficiently.
Picasso.with(getContext())
.load(R.drawable.marker)
.resize(width, width)
.into(new Target() {
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
markerOptionsHome = new MarkerOptions();
markerOptionsHome.title("Home location");
markerOptionsHome.snippet("");
markerOptionsHome.position(latlng);
markerOptionsHome.icon(BitmapDescriptorFactory.fromBitmap(bitmap));
homeLocationMarker = map.addMarker(markerOptionsHome);
}
@Override
public void onBitmapFailed(Drawable errorDrawable) { }
@Override
public void onPrepareLoad(Drawable placeHolderDrawable) { }
});