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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:25:41+00:00 2026-05-27T17:25:41+00:00

In Android webview, you could pass something like this file:///android_asset/myfile.txt or this http://www.mysite.com/t.html and

  • 0

In Android webview, you could pass something like this file:///android_asset/myfile.txt or this http://www.mysite.com/t.html and it will get it without a problem. Now if I tried the first url with the file prefix in a reader “FileReader” it will throw an exception that File not found although in WebView it work with no problem (why?)

What I want is to create a function that could take a file or http url and get the content html using the full path “file:/// …” how could I do this without facing the file not found exception ?

  • 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-27T17:25:42+00:00Added an answer on May 27, 2026 at 5:25 pm

    Now if i tried the first url with the file prefix in a reader “FileReader” it will throw an exception that file not found although in WebView it work with no problem (why?)

    Because “File Reader” does not have an asset named /myfile.txt, presumably. “File Reader” is somebody else’s program, not yours, so file:///android_asset/myfile.txt refers to an asset in that other program, not yours.

    What i want is to create a function that could take a file or http url and get the content html using the full path “file:/// …” how could i do this without facing the file not found exception ?

    Have an asset named /myfile.txt in your app.

    I have not tried using standard Java I/O (e.g., File objects) to read file:///android_asset paths. That might work. If not, use startsWith() to determine if the string begins with file:///android_asset — if it does, trim that off and use the rest with AssetManager to read the asset.

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

Sidebar

Related Questions

i 'm doing a project using webview in android. i can't visit url: http://www.baidu.org
I am using Webview in an Android activity (say Activity B ) like this
I can show up HTML file content in android webview well.Now how could i
Is it possible to get a Android WebView to open a port like: 5984?
I would like to diplay AdSense Ads in A WebView in Android. I know
I implemented the simple webview app through android to point to an html file
I was reading over http://android-developers.blogspot.com/2009/04/backward-compatibility-for-android.html But I'm really not grasping how to ignore certain
I am newbie to Android development and this webview and webview client is killing
I'm creating video music search in android WebView and I wanted users can launch
Does anyone knows an alternative to Android's webview component ? For some reasons, it's

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.