The similarity between HTML5 canvas and Android canvas

The new year for me is to learn both the HTML5 Canvas and the Android Canvas API. (I do a lot of Swing science stuff and need to fork) How similar are they to concept and execution? Are they similar enough that it makes sense to try to learn together at the same time? Or are they really different, and I should probably focus on one at a time to avoid confusion?

+6
source share
2 answers

I made extensive use of Swing Graphics, HTML5 canvas, and Android Canvas, and they are very similar. If you know how to use one of them, you will quickly learn how to use the other two. The concepts are almost the same. The biggest difference is how Android stores some of the graphic states (it uses the Paint object that you pass into the drawing functions, instead of setting the state directly on the canvas.)

I would suggest focusing on one of them first, just to make things a little easier.

+4
source

I can tell you this ...

They are, of course, similar, the most obvious difference is that HTML5 Canvas is designed for cross-platform, where Android Canvas is highly specialized, even proprietary. But just to go down to him.

HTML5 Canvas is based on a web server and uses the javascript web language to draw on canvas. Android is javascript and relatively the same.

I work with HTML5 Canvas and is very flexible and powerful. I enjoy the color rendering system, with my experience, normalizing color in different systems helps a lot (especially with color charts). I have been experimenting with text animations and particle effects lately and I think it is great for small screen applications! Lightweight physics also makes it a great choice for more complex implementations. Good cross compatibility for my apps / web hybrid apps (SaaS / SaP / B2B solutions)

HTML5 is young, so itโ€™s not without problems, but I think that with a properly encoded site and SaaS / SaP / B2B Application, any desired result is possible. But there is a lot of info on the stack about problems loading HTML5 Canvas on Android phones, etc.

I read somewhere else on the stack that PhoneGap might be the solution for you. Here is a great diagram that can help you: Mobile framework

Hope this helps you!

+1
source

Source: https://habr.com/ru/post/905017/


All Articles