1) For “static” files, you can use R class and use the browser to
render them
2) For runtime-generated files or “out-of-resouces” class, you can’t
use file:// URIs anymore
2)a) A possible solution: manually open the file and provide file
content as string, mimetype and encoding
2)a)issue) WebView must be used calling loadData method, which doesn’t
allow load content from network (so you can’t make it render external
images)
2)b) Another possible solution: create a content provider which
returns file content, mimetype and encoding by accessing a content://
URI. Theorically you can use WebView calling loadUrl method, which
renders the page correctly
Advertisement