0

I want to load an html file with its folder containing images and .css files from the phones internal storage to an apps android-webview. i have tried a lot of examples from the net but nothing works.. i am new to android. i found and tried something like this

private String curURL = "file:///data/data/com.yourproject.example/files/index.html"; 
webview.loadUrl(curURL);

and many other more. But i cannot find the path inside my phone "com.yourproject.example" even after i run the app and i have looked every folder inside because it is where i would suppose to put this folder "files/index.html" i assume. I know this is just easy for you guys but i am getting no luck in this.

Christian
  • 21
  • 4

1 Answers1

0

Create a folder assets and place you required files there. follow this answer

Community
  • 1
  • 1
Zeeshan Shabbir
  • 6,704
  • 4
  • 38
  • 74
  • no i don't want my files to built with the app. i want my files to be just in my device's internal storage and will be just called from there to the apps webview – Christian Jan 06 '16 at 00:41
  • Hi, did you have any updates on this question? I have a similar problem. I want to download a zip with an html file, decompress it in the `data/data/cache` directory and use it. The problem is that I can run the html file from the assets folder, but not from the `data/data/cache` directory (blank page is displayed). Thanks. – Edison Spencer Jan 25 '16 at 16:09
  • Hi, in my case, I was extracting the files, but when accessing I was forgetting to pre append the `file://`. So for me, that was the solution. How about you? Have you solved your issue? – Edison Spencer Jan 26 '16 at 13:32