For a full free drawing of the marker icon the code may look like the following.
In this case only the text is the content of the marker. But you can draw anything into the canvas. Just make sure to adapt the size.
public BitmapDescriptor getTextMarker(String text) {
Paint paint = new Paint();
/* Set text size, color etc. as needed */
paint.setTextSize(24);
int width = (int)paint.measureText(text);
int height = (int)paint.getTextSize();
paint.setTextAlign(Align.CENTER);
// Create a transparent bitmap as big as you need
Bitmap image = Bitmap.createBitmap(width, height, Config.ARGB_8888);
Canvas canvas = new Canvas(image);
// During development the following helps to see the full
// drawing area:
canvas.drawColor(0x50A0A0A0);
// Start drawing into the canvas
canvas.translate(width / 2f, height);
canvas.drawText(text, 0, 0, paint);
BitmapDescriptor icon = BitmapDescriptorFactory.fromBitmap(image);
return icon;
}
Then use this method when building the marker options:
mMap.addMarker(new MarkerOptions()
.position(new LatLng(lati, longi))
.icon(getTextMarker("some text"));