Reputation: 15729
A New Year's resolution for me is to learn both the HTML5 Canvas and the Android Canvas API. (I do a lot of Swing scientific graphics stuff and need to branch out) How similar are they in concept and execution? Are they similar enough that is makes sense to try to learn both together at the same time? Or are they really different and I should probably focus on one at a time to avoid confusion?
Upvotes: 6
Views: 2548
Reputation:
I can tell you this...
They are of course similar, the most obvious difference being that HTML5 Canvas is designed to be cross platform where as Android Canvas is highly specialized, proprietary even. But just to get down to it..
HTML5 Canvas is web/server based and uses web language javascript to draw on the canvas. Android is javascript and relatively the same.
I've been working with HTML5 Canvas and its very flexible and powerful. Im enjoying the color rendering system, with my experience the color normalization across systems helps a lot (especially with color sensitive charts). I've been experimenting with text animations and particle effects lately and I think its great for small screen applications! The easy of physics also makes it a great choice for more advanced implementations. Good Cross compatibility for my app/web hybrid apps (SaaS/SaP/B2B solutions)
HTML5 is young so its not without its problems, but I think with a properly coded website & SaaS/SaP/B2B Application any desired result is achievable. But there is plenty of information on stack about issues with loading HTML5 Canvas on Android phones & etc.
I read somewhere else on stack that PhoneGap might be a solution for you. Here is a great chart that could help you: Mobile Frameworks
Hope this helps you!
Upvotes: 1
Reputation: 98501
I've used Swing's Graphics, HTML5's Canvas and Android's Canvas extensively and they are very similar. If you know how to use one of them, you'll quickly learn how to use the other two. The concepts are pretty much the same. The biggest difference is how Android stores some of the graphics state (it uses a Paint object you pass to the draw functions instead of setting the state directly on the Canvas.)
I would advise you to focus on one of them first, just to make things a bit easier.
Upvotes: 5