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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:36:07+00:00 2026-05-31T04:36:07+00:00

My Android app uses HTML files included as assets and displays these inside WebViews.

  • 0

My Android app uses HTML files included as assets and displays these inside WebViews.
The HTML files must reference other files created dynamically by my application. The dynamic content cannot be included statically in /assets nor should it be fetched online every time the HTML is loaded inside the WebView. Instead, the app must fetch/generate the online content once and store it for future reference when an HTML file is displayed.

I have found two solutions up to now, and neither is satisfactory:

  1. Place all content inside /assets statically. Then I can reference it inside the HTML files as follows:

    TAG src=”image.gif” END_TAG

  2. Store the dynamic content in the sdcard and reference it from HTML as follows:

    TAG src=”/sdcard/app/image.gif” END_TAG

The first solution does not allow for dynamic content as (I think that) I cannot write to /assets dynamically. The second solution works but it is not great. First, I hard-encode references to /sdcard which I do not feel comfortable with. Second, the device has to have an SD card installed and mounted.

Overall, I would prefer the be able to store the dynamic content inside the app’s on-device memory and then reference it from HTML. Is this reasonable/good-practice/possible?

Note that the “dynamic content” is not so dynamic — it is updated very rarely and I want to have it cached.

Thanks,

  • 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-31T04:36:08+00:00Added an answer on May 31, 2026 at 4:36 am

    The first solution does not allow for dynamic content as (I think that) I cannot write to /assets dynamically.

    Correct.

    Overall, I would prefer the be able to store the dynamic content inside the app’s on-device memory and then reference it from HTML. Is this reasonable/good-practice/possible?

    Possible? Yes. Create a ContentProvider to serve your content, then use content:// URLs, and it should work.

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

Sidebar

Related Questions

I have created an App Widget for Android 1.5. It uses a TextView to
I am writing an app in Android that uses a WebView to display HTML
I created a native Android app that basically hosts a webView control. That webView
I am working on an Android app that uses the gdata-java-client to download documents
I have an Android 3.0 App with a WebView inside. The webview opens an
I implemented the simple webview app through android to point to an html file
i am using following code in my app: import android.app.Activity; import android.os.Bundle; import android.text.Html;
My Android app uses an sqlite table where one of the columns is a
I have an Android app that uses a WebView to enable users to install
My Android app uses Button widgets with default style, which looks fine except on

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.