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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:47:23+00:00 2026-05-26T03:47:23+00:00

I’m developing an application which has some assets bundled with it – they are

  • 0

I’m developing an application which has some assets bundled with it – they are mostly web pages with associated graphics, css etc which I’ll display in a custom WebView. I’m trying to work out how to serve up different assets to different devices without massive duplication.

I’d like to replicate the res folder, but for assets. For example:

assets/html/page1.html references assets/html/example_pic.png but I want to serve up a different example_pic.png depending on screen density or screen size.

Ideally I’d like to have something like assets_hdpi/html/example_pic.png and assets_mdpi/html/example_pic.png

Is there an elegant way of achieving this? Can I somehow utilise the /res/ folder management to the same end result by putting the example_pic.png in to /res/drawable_hdpi etc and then somehow pointing the webpage to the drawable?

  • 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-26T03:47:24+00:00Added an answer on May 26, 2026 at 3:47 am

    A possible workaround:
    Prepare a ‘subpath’ named string for the different resolutions you want to address, e.g.:

    res/values-hdpi/subpath.xml: <string name=”subpath”>hdpi</string>

    res/values-ldpi/subpath.xml: <string name=”subpath”>ldpi</string>

    Prepare corresponding subpaths in your asset folder, e.g.:
    assets/hdpi, assets/ldpi and store your assets there.

    Finally, use getResources.getString(R.string.subpath) to get the best asset subpath.

    String AssetPath= "file:///android_asset/"+getResources.getString(R.string.subpath)+"/";
    myWebView.loadPage(AssetPath+"index.html");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace

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.