0

I imported .html file into android application (assets/www/.html). Now i tried to access that data to my app as webview.loadUrl("file://android_assets/www/index.html");. But while running it in eclipse, Emulator is showing "webpage not available ". Any help is appreciatable.

1
  • Could it be that the file must be referenced locally? Maybe try it without "file:///" at all - just try "/android_assets/www/index.html" or "android_assets/www/index.html". Commented Nov 9, 2013 at 16:30

5 Answers 5

2

i guess you need to use file:///android_asset instead of file://android_assets in your file path.

webview.loadUrl("file:///android_asset/www/index.html");
Sign up to request clarification or add additional context in comments.

3 Comments

did you use three slashes instead of two? check my updated answer
I tried three slashes too.But it is not working.Any more suggestions?
try putting your html file in root (without www folder) and see if it makes any difference
0

I am not sure whether this is the solution to your problem. But maybe your application doesn't work because it tries to find a url in the internet instead of a file name. You should try uploading your file and change the location to http://... .

2 Comments

Where should i upload my file? I already imported to my app "asset/www/index.html".
It won't look for the file on the web. The URL has the "file://" protocol.
0

webview.loadUrl("file:///android_asset/www/index.html"); we have to import "jquery.dst.js" into "assets/www/css-js". css-js" is a folder.

Comments

0

if your using phonegap : you may use : super.loadUrl("file:///android_asset/www/index.html");

Comments

0

try out this may be helpful for you-

webview.setIntegerProperty("loadUrlTimeoutValue", 60000);
webview.loadUrl("file:///android_asset/www/index.html");

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.