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 8905339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:22:16+00:00 2026-06-15T02:22:16+00:00

I download a static map from Google Maps Static API. When I download the

  • 0

I download a static map from Google Maps Static API. When I download the image in browser, the size is ok (728×224). You can check the url from below.

But when I try to view it in my android app it’s to small (540×166). Of course I could display it with ‘centerCrop’ but it’s not ideal solution. As far as I know, both sizes are in pixels so it should fit perfectly. I log it this way:

 Log.i(TAG, "view size: "+mapPicture.getWidth()+"/"+mapPicture.getHeight());
 Log.i(TAG, "pic size: "+mapPicture.getDrawable().getIntrinsicWidth()+"/"+mapPicture.getDrawable().getIntrinsicHeight());

And the logcat looks like this:

11-29 21:41:37.547: I/DetailsFragment(18064): view size: 728/224
11-29 21:41:37.547: I/DetailsFragment(18064): http://maps.google.com/maps/api/staticmap?center=0,0&zoom=3&size=364x112&scale=2&sensor=false
11-29 21:41:37.547: I/DetailsFragment(18064): pic size: 540/166

I download the image with ImageManager and test on a hdpi device.

So why the downloaded pic has different size than it should?

Edit:
When I download an image twice as big, the drawable inside the ImageView is almost the same size as previously: pic size: 540/189

http://maps.google.com/maps/api/staticmap?center=52.2396,21.0174&zoom=14&size=729×225&scale=2&sensor=false

  • 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-15T02:22:17+00:00Added an answer on June 15, 2026 at 2:22 am

    Have you read this from here?

    Note: Prior to JELLY_BEAN, this function would not correctly retrieve
    the final configuration density when the resource ID passed here is an
    alias to another Drawable resource. This means that if the density
    configuration of the alias resource is different than the actual
    resource, the density of the returned Drawable would be incorrect,
    resulting in bad scaling. To work around this, you can instead
    retrieve the Drawable through TypedArray.getDrawable. Use
    Context.obtainStyledAttributes with an array containing the resource
    ID of interest to create the TypedArray

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

Sidebar

Related Questions

I am using the Static Google Maps API v2 to download a static image
I am trying to download some JSON from the google book API. The URL
I download an image from a url to an ec2 instance(wget), process it with
I want to pass several parameters to this url and generate the map from
I'm trying to download and save an image from the web using python's requests
I use this code to download string from the Internet public static async Task<string>
I'm using the code below to download this XML file : private async static
1.Download source from OpenSSL (openssl-1.0.0d). 2.Build it static using this: > perl Configure VC-WIN32
I have built a static version of qt and download a static version of
I want to download this picture using Ruby. How do I do that? http://farm1.static.flickr.com/92/218926700_ecedc5fef7_o.jpg

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.