Animation in Android's WebView - android

As far as I know, swf's and gif's inside WebViews are not officially supported by Android, eventhough they work in my HTC Desire Device.
I'm building an app that it's all based in a WebView. What i did is code the 'app' as HTML, put it into the 'raw' folder and once the app starts, it puts all the htmls and images into a folder on the SD (if they're not there yet).
Now I need display some animations in there. I made them with Actionscript and I was glad that it seemed to work (Animations were 25KB each), but after a while publishing it, i got reports from people that coulnd't see the animation.
Then I patched them into a GIF (raised memory to 400KB-1MB each). At this point, I decided to take the gifs out of the raw folder, and download them from one server in the web the first time the app runs, so my apk doesn't get too big. But I get complaints again that people can't see it (then I found that GIF is also unsupported)
Google-ing and stackoverflow-ing I found that the only solution is to split those GIFs into separate images and show them with javascript one by one to create the animation. I guess this method is OK for small animations (like some face saying hello or something like that), but for whole animations.... It weights about 3MB per animation (when the swf was 25KB...). And I think taking 30MB (possibly more in the future for new animations) from user's data quota is not nice.
So:
Is there any other solution?
Are there lots and lots of phones that don't support SWF? and GIF? If they're not too many, I would consider putting on my app's description that the animations won't work if the phone has low memory (animations are not very important into my app)
Thank you very much,
Víctor
edit: Additional information: Animations are like this one.

So... I found the only way was to use HTML5 canvas animation, since surprisingly it is supported by many devices.
The animation is not as smooth as in a GIF-compatible device, but I rather make it accessible for everyone.
So, CommonsWare answered my 2nd question, but I will answer my 1st one: Yes, use HTML5. It didn't take a huge work, since JS can be Object-Oriented as well, and syntax is fairly similar to AS3.
And the best part is that the base code only weights 34KB (let's say the engine plus all the images), and each animation (in a separate file) weights between 1 and 2KB. That was awesome, I can put them all into my Android's raw folder.
Thank you very much CommonsWare for your comment.

Related

How to use an asset in Android Ui?

I am new to Android Studio. While working on front end its sometimes easy to take some parts as png file and place it on the particular position instead of recreating it in xml file. I am confused can we use png all the time ? I am worried about memory space . Like the app contains 50 pages and in each page I use 1-2 assets . I don't want my app to have more than 40mb. What will be the best way to do? Can we store the image as a URL and retrieve it whenever we use. What's the drawback in that way?
So many questions :)
I am confused can we use png all the time ?
Use what's best for your picture. For a photo, a JPEG will probably do better. But if you wish, you can use PNG all the time, yes.
I don't want my app to have more than 40mb.
Check and see. Depends on how big your images are; we can't tell.
What will be the best way to do?
Not enough information to tell you that. In general, there's nothing wrong with using images in assets.
Can we store the image as a URL and retrieve it whenever we use.
Yes.
What's the drawback in that way?
You'll need to get some server space somewhere. Also, there will be a loading latency. Also, your app won't be usable while disconnected from the Internet.
While working on front end its sometimes easy to take some parts as png file and place it on the particular position instead of recreating it in xml file.
That's the part that is confusing to me. Android XML layouts usually contain interactive elements, ones that the user can interact with. Images, on the other hand, tend to be static. What kind of XML is there out there that you think you can replace by an image?

How to get images from Mobile Game Application?

I am making some Landing Pages and I need original images from mobile games applications.
I have iOS but no problem if you have solution with Android.
I just want to get like images, sounds from some game like “Clash Royae”, “Clash of Clans” something like that.
I can’t find anything usefull on Google...
Looking for fast responde,
Have a nice day!
The request you are making is probably takes long to get the images and sounds. You need to install emulator and get the file from application like .apk and have an application to uncompressed it. Then you will see all the files used in the application.

Rendering large images in WebView

I'm a newcomer in development of android apps. But, I'm undertaking what feels like a large project and I'm looking for information on whether it will work or not, before I get to far in.
As I've read, when trying to display very large images in android, it is most useful to use the "webview".
So, I took that advice, split my image into 1024 smaller images, and laid them out in an html table (not quite finished yet). Now, I'm noticing as the table gets larger my phone begins to lag upon scrolling.
My question is, is webview trying to render every single picture at once upon loading? If so, is there a way to make webview only render a set of images at one time? Let's say I'm at 14,000X x 24,000Y on the image, can I set webview to render the next 5,000px in each direction only, or is this necessary at all?
I can't seem to find the information I'm looking for, but will continue to search. Otherwise, any and all help is appreciated. Thanks!
i have exactly same problem and i found use full this library:
https://github.com/nostra13/Android-Universal-Image-Loader
you can configure a lot of parameters and using cache..

Are there any other GIF creation libraries for Android?

I'd really love to know if there are better GIF file creation libraries for Android development. I've already tried this one as well an NDK based one called gifflen (it's really old apparently). Both I've found are slow and produce low colour amount GIFs with incredibly big inflated file sizes with quality settings that don't seem to do anything. Worst comes to worst I could just write the thing myself but it would save a lot of trouble if anyone knows of an existing one, thanks in advance.

Flash Builder, loading assets for mobile devices

I am using flash builder to make an app for android/ios.
How would you recommend I use assets such as images and sounds. Should I embed them or use loader?
Any benefits to each one.
I have a fair amount of assets.
I am no expert on flash, but I ended up embedding the resources. The ease of compile-time resource checking. You just need to be sure to load each images/sounds when you have enough time to do so between frames.
For mobile apps embed is just easier. You don't need to worry about accessing the file system and purchasing/downloading is easier since you are not bundeling anything with it. The initial download will be about the same size unless you were planning on loading the assets to the device at runtime from the web. I would caution against that unless it was absolutely necessary. My experience is user are accustomed to a large download, but but load time of the app each time it opens should be minimal.
I also like that FlashBuilder will check your embed code and make sure the file is present and spelled correctly - one less thing to worry about

Categories

Resources