Creating an Android library and it consists of displaying a gif to the user.
From what I've read, you use a WebView to display a gif and this works to that API level 8.
So, I have it all working except showing the content, which is a drawable.
How would I get the URL for the loadUrl method to the drawable?
Normally, I'd use assets, but because this is a library, I can't do this.
Put this gif image in the assets folder.
you will be able to access the assets folder in the html webview like this
<img src='file:///android_asset/gif-file-name.gif\'/>
Related
I'm making a webapp and the webview of android studio isn't loading a particular gif but it loads all other images and gifs, but while the website loads the gif as usual. i had made the javascript in the website to show it until another image is loaded.
i tried settings.domStorageEnabled = true
and it doesn't seem to help ! please help me figure out what's the problem.
You can try the below cod snippet to load the .gif into webview:
Create a html file like this:
And store it in "assets" folder of you application also store your gif in the same folder. And do following to show it:
webview.loadUrl("file:///android_asset/your_html.html");
Other option is use the below lib.:
https://github.com/koral--/android-gif-drawable
If the answer is help you, please upvote.
I'm creating an HTML file with css and java, and I want to load an image using img tag, but Android isn't loading the image when using img src="" code.
The image is the phone's Download folder of the Android phone, but I can't figure out the path I have use to load the image in the HTML.
I recommend you to upload the image to a server like google photos or github so that you can copy its url and assign it to the source atributte of the element.
Give it at try and tell me if you have any problem!
I am working on application which loads data from server in webview. This data contains icons which are coming from .svg file. Problem is icons are rendering properly lower versions of Android, but in android lollipop instead of icon it shows random text.SVG file is added through css inside a html code which we load in webview.
Does any one know android Web View supports .SVG in Android lollipop?
Or
Do I required to do Lollipop specific changes on server side?
Thank You
I want to load a part of Website to Webview. Not completed Website.
How can I do it?
It is similar this question.
Load a div into a webview on Android
But the answer only load text. not have Image.
Any one there?
1.Create a HTML file with a frame (or iframe) in it and save it in your assets folder.
2.Load your file in webview from assets .
i have try to load swf in android.i use this :
but,i think that this is recommend to store SDCARD first and trying to display?
my question is, my point of view is correct or wrong?
i have try by android_asset but not get success.
First of all, I think you should use webview control to load SWF file. (if you have not done above).
Using webview, You can load swf file in any of following way,
Android Asset.
From SD Card.
URL from web.