In Android, I need to be able to draw simple graphics (points, lines, circles, text) on a large scrollable canvas (i.e the phone’s screen is a viewport in a much larger area). I have hunted for tutorials on how to do this without success.
“World Map FREE” on Android market is a good example of the sort of effect I need to achieve.
This must be a common problem, so I’m surprised I can’t find examples.
I’ve had to implement something fairly recently of this sort. Basically I had coordinates in my custom view that would shift where objects would be drawn, via some auxiliarry functions:
To actually implement the dragging, I wrote a custom onTouchEvent method to implement dragging: