title: Custom tile based map is slow
body: <p>I am working on a map for my public transit app. I'm using SurfaceView, it's a tile based map, there are 2 threads besides the main thread - drawing thread and bitmap loading thread.</p>
  
  <p>Bitmaps are 256x256 PNGs stored on the SD card, I am caching the loaded bitmaps, cache capacity is 64 bitmaps. There are different sets of bitmaps for every zoom level, my map has 4 zoom levels, every next level is 2x more zoomed.</p>
  
  <p>Unfortunately scrolling and pinch zooming is not smooth on my Nexus One, FPS is 15 - 20. When no tiles are being loaded FPS is 35 - 40. If I lower priority of the bitmap loading thread, it becomes completely smooth but I often see not yet loaded (white) tiles on the map - which is even worse than the non-smoothness.</p>
  
  <p>So what could I do? I have 2 ideas so far:</p>
  
  <ul>
  <li>Try OpenGL, but I don't want to spend time on it and then find out it my FPS only inreased by 3. Also I want to show popups (that scroll with the map) after user clicks on map markers, which I don't know how to do in GLSurfaceView.</li>
  <li>Set low priority to bitmap loading thread only when user touches the screen or when there's an ongoing animation. I tried that but for unknown reason it seemed to even worsen the problem a little bit, touching / not touching the screen didn't have any effect. If it was just some bug I can fix, there's still another problem. If I use kinetic scroll to quickly move the map, I will see many not cached bitmaps.</li>
  </ul>