• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Url of Files stored in Internal Storage

ptheg

Lurker
Hi,

in my App I want to generate some html files and store them in the internal storage. In my WebView I want to open the generated html by clicking a link. Does a Url to the stored file exist? Something like "internal://mygeneratedfile.html"?

Thanks in advance.
 
Hi,
in my App I want to generate some html files and store them in the internal storage. In my WebView I want to open the generated html by clicking a link. Does a Url to the stored file exist? Something like "internal://mygeneratedfile.html"?
Thanks in advance.

try this,
Code:
File file = new File( Environment.getExternalStorageDirectory() + "<directory>/<file_name>" );
wv.loadUrl( "file:///" + file.getAbsolutePath() );
:)
 
Hi thanks,

I solved it using getFilesDir() and fileList() to get the path. The link looks more or less this way:

/data/data/myproject/files/storedFile.html

P
 
Back
Top Bottom