7
\$\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\$
2
  • \$\begingroup\$ Is the issue in emulator or device?? \$\endgroup\$
    – Neerkoli
    Commented Oct 5, 2015 at 12:29
  • \$\begingroup\$ Only with device \$\endgroup\$ Commented Oct 5, 2015 at 12:39

1 Answer 1

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\$
1
  • \$\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\$ Commented Jan 29, 2016 at 12:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .