如何在 Android 上禁用数据连接(3g/gprs)
可能的重复:
如何在 Android 上禁用移动数据
我知道这是可能的版本 2.2 及更低版本,但自 2.3 起这是不可能的,除非您的应用程序具有 google 提供的证书并将其指定为安全应用程序,或者您将应用程序放在 /system/app 目录中。我尝试将应用程序放置在 system/app 目录中,发现即使具有 su 权限,这在模拟器上也是不可能的。我如何确保我的应用程序在 Android 市场上安全(这样谷歌会给我所需的证书)或将应用程序安装到系统/应用程序目录。唯一的另一种可能性是使用 ndk,但我不太确定它是否有效,并且需要花费时间和精力来解决这个问题,这将是一种痛苦。有人可以帮助解决这个问题吗?
Possible Duplicate:
How to disable Mobile Data on Android
I know that this is possible in version 2.2 and below but since 2.3 it is not possible, unless you have a application that has a certificate supplied by google that specifies it as a secure application or if you place your application in the /system/app directory. I have attempted to place the application in the system/app dir and found this to be impossible on the emulator even with su rights. How would I make my application secure for android market (so google will give me the certificates required) or install the application to the system/app dir. The only other possibility is to use the ndk, but i am not so sure if it will work and the time and effort that would have to go in to hack around this will just be a pain. Can some one assist in the problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 SDK 提供的方法禁用 3G 是不可能的,无论如何,我想我记得一个解决方案,其中 APN 设置为无效的 APN 来禁用 3G
编辑:
我刚刚发现 APNDroid 正是使用这种重命名解决方法来禁用 3G 连接。
此处您可以浏览应用程序的源代码
Disabling 3G using methods provided by the SDK is not possible, anyway I think I remember a solution where the APN was set to a invalid one to kind of disable 3G
EDIT:
I just figured out that APNDroid uses exactly this renaming-workaround to disable the 3G connection.
Here you can browse the source code of the application