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

  • Home
  • SEARCH
  • 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 3396764
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:26:48+00:00 2026-05-18T04:26:48+00:00

How do you display different images for different screen resolutions (hdpi, ldpi, mdpi) in

  • 0

How do you display different images for different screen resolutions (hdpi, ldpi, mdpi) in an embedded HTML resource of an Android app?

The HTML resource is located in assets, but can be changed if necessary.

If this is not possible, how do you change the display size of the image based on the screen resolution?

  • 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-05-18T04:26:49+00:00Added an answer on May 18, 2026 at 4:26 am

    I managed to do this with @media queries and -webkit-device-pixel-ratio. While the images have to be located in assets, you can use folders to organize them properly.

    @media screen and (-webkit-device-pixel-ratio:0.75) {
        #header {
            background-image: url('ldpi/background.png');
            width: 75px;
            height: 75px;
        }
    }
    
    @media screen and (-webkit-device-pixel-ratio:1.0) {
        #header {
            background-image: url('mdpi/background.png');
            width: 100px;
            height: 100px;
        }
    }
    
    @media screen and (-webkit-device-pixel-ratio:1.5) {
        #header {
            background-image: url('hdpi/background.png');
            width: 150px;
            height: 150px;
        }
    }
    

    According to the documentation (Building web pages to support different screen densities), this only works in Android 2.0 or higher.

    You never know enough CSS, it seems.

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

Sidebar

Related Questions

I'm trying to display some large images with HTML img tags. At the moment
I'm creating a splash screen that will display while my Android application loads. I'd
I have a site I made really fast that uses floats to display different
I'm working on a form that will display links to open different types of
On my start page, I'd like to display the first items from several different
I display data into an html table, w/ a drop down box with a
I am developing an application using WPF. The app runs full screen, and I
I want to create a view that has different displays according to the role
i noticed that paypal displays a very different favicon, one that's not just a
I have two strings and would like to display the difference between them. For

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.