Surface View lag. Looking for any help.

All your problems with Audio, Video and Images.

Surface View lag. Looking for any help.

Postby TheMidnight » Thu Mar 18, 2010 2:23 am

So when I sat down to begin work on an android project I read that using SurfaceView is what you needed to use if you were going to be making a "game". The game I am working on is supposed to move and update in real time. I have multiple images falling down the screen and one image that rotates. For some reason, If i take the DrawBitmap call for the image that rotates out of the code then everything falls at the rate it should. However if I put the call back in, the images falling slow down. They don't necessarily "lag" as in it isn't jagged. They fall smoothly, just at a much slower speed than they should. Is this due to the cpu not being able to keep up with the graphics card in the phone? I am at a complete loss as to how I can remedy this. I am using the given functions canvas.rotate and canvas.translate. If anyone has any insight I would love it. Thanks for any help.
TheMidnight
Freshman
Freshman
 
Posts: 7
Joined: Sat Feb 20, 2010 11:35 pm

Top

Postby TheMidnight » Thu Mar 18, 2010 3:09 am

UPDATE: Well, I think I might understand what is happening. For some reason the images falling are the only things slowing down. At the same time they are the only ones that are based on Real time which I get from calling the SystemClock.uptimeMillis(). If I tell the falling images a constant time has passed like 15 or something then they never slowdown. Am I somehow lagging the systemclock?
TheMidnight
Freshman
Freshman
 
Posts: 7
Joined: Sat Feb 20, 2010 11:35 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: Google Feedfetcher and 9 guests