Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9275075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:30:13+00:00 2026-06-18T16:30:13+00:00

I am developing an Android Application where I’m using Google Map API v2. I

  • 0

I am developing an Android Application where I’m using Google Map API v2. I need to show the user location on a map with custom markers.

Each marker will show the picture of the user from an URL. The image must be downloaded in asynchronous mode from the server. See the attached screenshot for an example.

How do I add an image and custom information in the marker?

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T16:30:14+00:00Added an answer on June 18, 2026 at 4:30 pm

    In the Google Maps API v2 Demo there is a MarkerDemoActivity class in which you can see how a custom Image is set to a GoogleMap.

    // Uses a custom icon.
    mSydney = mMap.addMarker(new MarkerOptions()
        .position(SYDNEY)
        .title("Sydney")
        .snippet("Population: 4,627,300")
        .icon(BitmapDescriptorFactory.fromResource(R.drawable.arrow)));
    

    As this just replaces the marker with an image you might want to use a Canvas to draw more complex and fancier stuff:

    Bitmap.Config conf = Bitmap.Config.ARGB_8888;
    Bitmap bmp = Bitmap.createBitmap(80, 80, conf);
    Canvas canvas1 = new Canvas(bmp);
    
    // paint defines the text color, stroke width and size
    Paint color = new Paint();
    color.setTextSize(35);
    color.setColor(Color.BLACK);
    
    // modify canvas
    canvas1.drawBitmap(BitmapFactory.decodeResource(getResources(),
        R.drawable.user_picture_image), 0,0, color);
    canvas1.drawText("User Name!", 30, 40, color);
    
    // add marker to Map
    mMap.addMarker(new MarkerOptions()
        .position(USER_POSITION)
        .icon(BitmapDescriptorFactory.fromBitmap(bmp))
        // Specifies the anchor to be at a particular point in the marker image.
        .anchor(0.5f, 1));
    

    This draws the Canvas canvas1 onto the GoogleMap mMap. The code should (mostly) speak for itself, there are many tutorials out there how to draw a Canvas. You can start by looking at the Canvas and Drawables from the Android Developer page.

    Now you also want to download a picture from an URL.

    URL url = new URL(user_image_url);
    HttpURLConnection conn = (HttpURLConnection) url.openConnection();   
    conn.setDoInput(true);   
    conn.connect();     
    InputStream is = conn.getInputStream();
    bmImg = BitmapFactory.decodeStream(is); 
    

    You must download the image from an background thread (you could use AsyncTask or Volley or RxJava for that).

    After that you can replace the BitmapFactory.decodeResource(getResources(), R.drawable.user_picture_image) with your downloaded image bmImg.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an android application using google maps. I have to display some
I'm developing Android application, and I need to disable letters for user's keyboard in
I'm developing android application for CAR usage and I need that in phone or
I started developing an Android application that record a video and I need to
I am developing android application which requires user to Login. This application relies on
I'm developing Android application using third party libraries (Twitter4j). I want to be able
I am developing an android application that simply start and stop recording using Buttons.
I am developing android application using phonegap. I am using only one HTML page(index.html).
I'm developing android application using eclipse and svn for version control. I wanted to
i am developing android application using Geocoder services, I have an application where I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.