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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:09:37+00:00 2026-06-02T01:09:37+00:00

Although I know image resolutions and support them on the android is a fairly

  • 0

Although I know image resolutions and support them on the android is a fairly common question surrounding android I can’t seem to find any questions or postings on-line that deal with what I’d like to do.

I have a map which I set as the background of the android device. I then overlay touchable points and images where a specific city exists. My problem is how do I should I correctly deal with positioning the cities on different devices?

I’ve got different images for different dpi’s if someone was to ask. However is the correct way to pin the position of x and y in this case using a percentage based on the scaled size of the background. It’s the solution I keep coming back to however I’m yet to work out a way to get the scaled size of a background image.

Any feedback would be appreciated.
Ryan

  • 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-02T01:09:39+00:00Added an answer on June 2, 2026 at 1:09 am

    It is really difficult within Android to try to layer images onto a specific location in the background using some combination of dpi/weights. One of the problems is how does the background scale? Are you using the suggested 9-patch images or just letting android crop or scale down your image? Even after this the “dpi” value of the phones isn’t exact, the OS is just using a predefined multiplier (such as 1.5x for hdpi) to quickly estimate the size of the image. To get the “true” dpi you would need something like:

    DisplayMetrics dm = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(dm);
    
    float xDpi = dm.xdpi;
    float yDpi = dm.ydpi;
    

    and use those values in your calculation. In the end it really is best to simply use the true values of the screen and use percentages like you stated. I believe that is how most OpenGL apps do it as well (someone correct me if I’m wrong) and apps like this that are on the verge of using a graphics engine should probably behave similarly.

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

Sidebar

Related Questions

I need to know how I can draw an image on a canvas element,
I know this should be fairly easy but I can't quite figure it out
I know the image is valid because I can convert the IplImage to an
Although I know the basic concepts of binary representation, I have never really written
The following query hangs: (although subqueries perfomed separately are fine) I don't know how
Although obviously not all scenarios can be covered by a single design, is it
Although this is FAQ i still couldn't find a suitable solution. I'd like to
Although using daily in my programming , but never realized about this question :
I know there are similar, more complex posts around, but I just can't get
I'm trying to build a gallery with text below the image but although I've

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.