Android Question WebView with Assets resources

Hi, is it possible to have local js, css files e.g on my assets folder and then reference them inside my webview html source? If possible can you please provide some guidance? Thanks a lot

Yes that's possible.

You'd reference your local files using the syntax: "file:///android_asset/my_asset_name.abc" within your HTML code.
So an IMG element might look like:

PHP: Copy
<img src="file:///android_asset/logo.png">

Martin.
 
Upvote 0
Just to add...

You can also directly reference various (built in) android drawable resources.
This is the syntax:

PHP: Copy
<img src="file:///android_res/drawable/ic_more.png">

That'll display the built in system drawable 'ic_more'.

Martin.
 
Upvote 0
Back
Top