libGDX: Low FPS on Android devices… here is a solution to the problem.
libGDX: Low FPS on Android devices
In my game, I create many loops and methods in render
. My laptop’s FPS ranges from 56
to 60
, no problem. However, when I run it in the Android operating system of the Galaxy Note 4, the FPS ranges from 24
to 45
, which is not normal.
Now I need a new render thread, synchronous rendering:
Gdx.app.getApplicationListener().render();
Can anyone help me with this?
Solution
Even low-end laptops typically have much more processing power than high-end smartphones, so the ability to run smoothly on a laptop can lag significantly behind on the Galaxy Note.
You provide almost no information in the question, so what I can suggest is the general approach;
- Analyze the games on your phone to identify possible bottlenecks so you do
Can be dealt with.
http://developer.android.com/tools/debugging/debugging-tracing.html - OpenGL analytics is also helpful, and you can monitor the context
Switches and so on.
https://github.com/libgdx/libgdx/wiki/Profiling - Also, according to general experience, do not be in
Render loops, or execute as little as possible when absolutely necessary.
Initializing a pool of reusable objects at the beginning can help you a lot.
https://github.com/libgdx/libgdx/wiki/Memory-management