1. Are you ready for the Galaxy S20? Here is everything we know so far!

Nagging issue with Multiple tablets

Discussion in 'Android Development' started by steve reine, Dec 30, 2020.

  1. steve reine

    steve reine Lurker
    Thread Starter

    I've written an Android app for data logging temp and humidity from sensors in the house, via wifi and and Arduino. I'm currently running the app on three tablets;

    LG LGLK430
    Samsung SM-T110
    ACER B3-A40

    The app itself runs fine on all three devices, that is, until the screen savers kick in, or if I rotate the screen.

    Once I rotate the screen, or awaken the device from the screensaver, the app acts as if it is restarting and the plotted data returns to its init values.

    Does anyone know how to get around this issue?

    Regarding the screensaver, I've done everything that I can to prevent the screen savers from activating.

    I've tried using the following recommended code in the manifest file;

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"

    <uses-permission android:name="android.permission.WRITE_SETTINGS"

    and the following in the main activity file;

    android.provider.Settings.System.putInt(getContentResolver(), Settings.System.SCREEN_OFF_TIMEOUT,21600*1000);

    Also, I've gone to file-settings-editor-inspections-'Using system app permissions' and unchecked the box.

    When I do all of this, the code compiles fine but I still get the following error when running the app;

    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.a_steve_app3/com.example.a_steve_app3.MainActivity}: java.lang.SecurityException: com.example.a_steve_app3 was not granted this permission: android.permission.WRITE_SETTINGS.

    thoughts anyone?


    Does this point to a permission setting on the devices? I've gone through the settings on all three devices looking for permissions options.

    1. Download the Forums for Android™ app!



Share This Page