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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:35:34+00:00 2026-06-04T23:35:34+00:00

Can anyone help, i am finding it difficult to get the DPI of a

  • 0

Can anyone help, i am finding it difficult to get the DPI of a handset, mentally (understanding it) and get the value in code 🙂

For example, it states the density is the following (taken from android docs)

ldpi    Resources for low-density (ldpi) screens (~120dpi).
mdpi    Resources for medium-density (mdpi) screens (~160dpi). (This is the baseline density.)
hdpi    Resources for high-density (hdpi) screens (~240dpi).
xhdpi   Resources for extra high-density (xhdpi) screens (~320dpi).

but why is it only state as ~240dpi, ie. one value? should it not be (for example) a mobile (samsung galaxy S2) is of WVGA (800 x 480) (DPI), what does the symbol ~ mean?

So taking a simple example of 800 x 480 (the dpi of a samsung galaxy s2), how is this converted into one of the values above?

I wonder if anyone can help me mentally understand this.

Then later is it possible via code to get the Density Size, DPI (including x and y) via code?

I am a little lost

  • 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-04T23:35:36+00:00Added an answer on June 4, 2026 at 11:35 pm

    but why is it only state as ~240dpi, ie. one value?

    What were you expecting?

    what does the symbol ~ mean?

    As the commenters pointed out, this means “approximately”. In reality, device manufacturers will choose what density bucket they want their device to be in, typically based on their testing with the behavior of real-world apps. Generally, they will choose the closest density bucket to their actual screen density, but this is not guaranteed.

    So taking a simple example of 800 x 480 (the dpi of a samsung galaxy s2), how is this converted into one of the values above?

    You don’t. Resolution is not density. I could have an 800×480 display that is 1mm, 1cm, 1m, or 1km in diagonal size. Each of those would have a different screen density as a result. Density is measured in dpi = “dots” per inch = pixels per inch.

    Then later is it possible via code to get the Density Size, DPI (including x and y) via code?

    Yes, from a DisplayMetrics object.

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

Sidebar

Related Questions

Can anyone help me in finding some code examples or tutorials to understand how
I get this error, Can anyone help me in finding my mistake in the
Can anyone help me to get good WordPress interview questions and answers. Any link
I am finding it difficult in understanding how I can use the android accelerometer
Can anyone please help in finding the solution of the above question I have
Can anyone help me with finding regular expression for the below $string = id=A12dk9-mds&name=4950;
Can anyone please help me in finding good tutorials for php/jquery/ajax form submission validating
Can anyone help - this is driving me mad. I am calling a mysql
Can Anyone help me why x2 prints zero. I guess because of floating point
Can anyone help me how to split /explode verse format to 3 parts? The

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.