6
\$\begingroup\$

When I open my Android app after 5 or 10 seconds it sets up the sensor listener, during which I see clear stuttering and the FPS drops for a second to 40 instead of 60.

Is there a way to avoid this?

I am working in Android Studio with LibGDX.

\$\endgroup\$
  • \$\begingroup\$ Is the issue in emulator or device?? \$\endgroup\$ – WeirdElfB0y Oct 5 '15 at 12:29
  • \$\begingroup\$ Only with device \$\endgroup\$ – Timothy Oct 5 '15 at 12:39
0
\$\begingroup\$

I am not sure what you mean with Sensor Listener, but In case you mean accelerometer and other mobile phone sensonrs. You can disable them with this code:

AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
config.useAccelerometer=false;
config.useCompass=false;
initialize(new yourGame(), config);

More information on the LibGDX Wiki

\$\endgroup\$
  • \$\begingroup\$ It says "sensor listener setup" in the console. I already had the Accelerometer and the Compass disabled. However it somehow solved the problem over time so I guess it's best to remove this question since it's a bit vague ? \$\endgroup\$ – Timothy Jan 29 '16 at 12:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.