I asked a similar question to this awhile back and got zero responses, so I’m going to try rephrasing it . . .
What is “best practice” for ensuring that the 2D drawing primitives in the Canvas class scale properly for different devices (phones with different screen resolutions)? Are they supposed to scale automatically? Is there a way to scale the whole canvas? Am I supposed to detect the size and do my own scaling as I draw each line, circle and point individually? Am I supposed to do it by manipulating the View? Or what?
The goal is to make sure the graphics fill up the screen to take full advantage of the available resolution, but don’t overflow it.
Thanks in advance!
The way I do it in my app is by keeping track of the size of my
View:Then whenever I need to manually draw something, I do it in terms of a percentage of the total resolution. Your mileage may vary depending on exactly what you are trying to do.