Android SurfaceView slows if no touch events occur

情到浓时终转凉″ 提交于 2019-12-03 17:33:26
fadden

Your observation is correct. In short, the power management in the N5 aggressively throttles the power down. If your finger is in contact with the screen, the clock speeds are increased to ensure that interactions are smooth. (For more, see my answer to this question.)

The best way to handle this is to recognize that you will need to drop frames sometimes. The "Record GL app" activity in Grafika uses a simple trick with Choreographer to do this. See also this article for some additional thoughts about game loops.

alp

I think you should try to make your game more battery saving,darker the game(using background layout #000) more power for game , also you can use Intent flags like clear top to kill previous activity for saving battery , clearing ram(avoid out of memory)

but for your situation you can use wakelock

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!