How to access device settings programmatically?

前端 未结 6 1675
礼貌的吻别
礼貌的吻别 2020-12-05 05:59

Is there any way to access device settings programmatically?

For Example: Settings > Developer Options > USB debugging > True/False

Thanks in advance.

<
6条回答
  •  萌比男神i
    2020-12-05 06:14

    I know that this question is old but is interesting.

    Nandeesh's solution works well. But it does not work if you want to change certain settings such as USB Debugging. You have to use the following permission.

    
    

    But, it doesn't work with non system apps. However, it is POSSIBLE to do this if you have root access. You can try this solution where the author solves the exact same thing.

    You can also try https://github.com/alseambusher/adb-toggle

提交回复
热议问题