Toggle gps on root devices on Android

后端 未结 3 2075
不知归路
不知归路 2020-12-06 20:03

Starting with some Android version (I think 2.3.x), you cannot turn on/off the GPS via the API, no matter what permissions the app has. In the past, it was possible by explo

3条回答
  •  忘掉有多难
    2020-12-06 20:21

    This SO Question seems to be the closest to anything related on the topic.

    There was a bug exploit up until version 2.2 which enabled changing the GPS setting. After 2.3, it seems as if it's currently impossible to do without user intervention.

    Here are the answers/comments of several unsuccessful attempts: - How can I enable or disable the GPS programmatically on Android? - https://stackoverflow.com/a/10004614/238722

    Apparently there is a way of doing it with BusyBox, but I can't find anything solid online. Source: https://stackoverflow.com/a/14850224/238722

    UPDATE

    The answer linked related to BusyBox contains this working sample project available for download.

提交回复
热议问题