is there a way to turn sleep mode off in android? o a way to control its timer programmatically?
I really need my app to run all the time (or at least 1 hr) and devices only allow for 10 mins max on the sleep mode timer
I managed to fumble my way through adding some new functionality to ofxAndroidUtils.
in OFAndroid.java
import android.provider.Settings;
static public void screenBrightness(int bri) {
Context context = getContext();
// code from here: https://www.geeksforgeeks.org/how-to-maximize-minimize-screen-brightness-programmatically-in-android/
// Change the screen brightness change mode to manual.
Settings.System.putInt(
context.getContentResolver(),
Settings.System.SCREEN_BRIGHTNESS_MODE,
Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL
);
// Apply the screen brightness value to the system, this will change
// the value in Settings ---> Display ---> Brightness level.
// It will also change the screen brightness for the device.
Settings.System.putInt(
context.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, bri
);
}