Take the 2-minute tour ×

Ive been trying to make a scrollable/zoomable app and everything has gone great except for drawing bitmaps. It is a very large image (6656 by 4096) that i have split into tiles. There is a rectangle array that the bitmaps are drawn to, and it detects what rectangle is in the top left corner so it can draw the bitmaps that will cover the user's viewable screen. My problem is this all lags when the app has to load the bitmaps into memory; Once they are loaded it isnt an issue. I started with 512 by 512 tiles, then went down to 128 by 128. although it helped, there still is some noticeable lag. I have been looking into surfaceView and wanted your opinions if i should stick with View, or use surfaceView to solve my lag.

share|improve this question

1 Answer 1

up vote 9 down vote accepted

If you derive your own SurfaceView you have several advantages.

Mainly because you can have all drawing logic in a seperate thread. This means that the ui won't wait for you (I'm assuming the lag is because the ui-thread is being blocked?).

SurfaceView's are also faster in nature.

I also find this overview on developer.android.com to be a good reference to choose drawing method.

share|improve this answer
SurfaceView did turn out to be much faster and better suited, thanks. –  jfisk Jul 30 '10 at 20:02

Your Answer


