在应用程序退出时关闭 bt/gps/wifi 是否明智?
我有一个处理 GPS 数据的 Android 应用程序。当用户启动它时,它会提示打开 GPS。
如果我对应用程序进行编码以在用户关闭应用程序时自动关闭 GPS,这是否明智?
自动关闭 Wi-Fi 或蓝牙怎么样?
I have an Android app that deals with GPS data. When a user starts it, it offers to turn on the GPS.
Is it smart (or is it bad) if I code the app to automatically turn off the GPS when a user closes the app?
What about automatically turning off Wi-Fi or Bluetooth?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从 Android 1.6 开始,就无法以编程方式关闭/打开 GPS。您所能做的就是启动系统首选项屏幕,该屏幕允许用户为所有应用程序禁用/启用它。
Since about Android 1.6, it has not been possible to turn GPS off/on programatically. All you can do is launch the system preference screen, which does allow the user to disable/enable it for all applications.
我认为每个用户的答案都不同,所以让用户选择:在要求打开 GPS 等的消息框中,只需添加一个复选框,显示“退出应用程序时关闭这些”,人们可以在接受之前进行检查。
I think the answer is different for every user, so let users choose: On the messagebox that asks to turn on the GPS etc just add a checkbox saying "turn these off when exiting the application" that people can check before accepting.