Note that there are some explanatory texts on larger screens.

plurals
  1. POWeird performance issue with Galaxy Tab
    text
    copied!<p>I am working on a 2d tutorial and was able to test my current tutorial part on a Samsung Galaxy Tab.</p> <p>The tutorial simply moves the default icon randomly over the screen. With a tap I create a new moving icon. Everything works fine (constantly 60fps) on the Galaxy as long as I have 25 elements or less on the screen.</p> <p>With the 26th element the frame rate drops to 25fps.</p> <p>When I change the size/dimension of the image to a much bigger one, I reach less than 25fps before the 26th element. Thats ok. But at some not really reproducible number of elements the frame drops from (mostly more than) 10fps to 1fps.</p> <p>On my Nexus One I can add 150 elements and still have 50fps.</p> <p>What I have done: I changed the bitmap variable to a static one, so not every element has his own image but all use the same. That removed the behavior, but I doubt this solution is a good one. The magic number of 25 would suggest that I can use only 25 different images in that way.</p> <p>Does someone have any idea what can cause this behavior? Is it a bug in the modified android version of Samsung?</p> <p>My <a href="http://www.droidnova.com/blog/wp-content/uploads/2011/03/2d-tutorial-part5.zip" rel="noreferrer">sample eclipse project is available</a>. I would appreciate if some Samsung owner would check their performance with the sample.</p> <p><strong>edit</strong></p> <p>A colleague found a solution. He changed the way the bitmap is loaded from</p> <pre><code>mBitmap = BitmapFactory.decodeResource(res, R.drawable.icon); </code></pre> <p>to</p> <pre><code>mBitmap = BitmapFactory.decodeStream(new BufferedInputStream(res.openRawResource(R.drawable.icon))); </code></pre> <p>But we still don't really get it why it works this way...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload