I followed the best practices for creating layouts for different screen sizes according to this guide: http://developer.android.com/guide/practices/screens_support.html
Now I started processing the drawing using the methods of the Canvas class:
eg. canvas.drawLine (60, 320, 120, 320, linePaint);
Can someone help with how I should make these pixel values ββ(60/120 / etc) in density pixels so that the line is scaled correctly? Otherwise, the line will not be displayed as I expect it to be too far and too long on smaller screens, for example.
Thanks for any answers.
source share