如何启用/在Android SDK中禁用3G / 2G [英] How to enable/disable 3G/2G in Android SDK

查看:164
本文介绍了如何启用/在Android SDK中禁用3G / 2G的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道如何启用/禁用3G / 2G采用了Android SDK,而不仅仅是intenting到3G设置页面。谢谢。也就是有没有办法做同样的事情,但与GPS功能。谢谢!

I am just wondering how to enable/disable 3G/2G using the Android SDK and not just intenting to the 3G settings page. Thanks. Also is there a way to do the same thing, but with GPS. Thanks!

推荐答案

没有出口的SDK功能2G和3G之间切换。对于给定的设备,你也许可以找出私人的功能,但它不会工作,除非应用程序与系统密钥签名。

There is no exported to the SDK functionality to switch between 2G and 3G. For a given device you could probably figure out the private functionality, but it wouldn't work unless the app was signed with the system key.

您可以禁用无线电不过,通过启用飞行模式。

You can disable the radios though, by turning on airplane mode.

和你也许可以做出直接打开,而不是通过菜单的几级到那里进行适当的设置活动,一个快捷方式。

And you might be able to make a shortcut to open the appropriate settings activity directly, instead of going through a few levels of menus to get there.

如果你让自己的身材,您可以presumably加入你真正想要的功能,但是这可能不是有用的人,但你自己。

If you make your own build, you can presumably add the capability you really want, but that's likely not useful to anyone but yourself.

编辑:进一步的细节 - 了解它是如何工作的,看在设置菜单code(缺省版本,一个给定的设备会有所不同):

further detail - to understand how it works, look at the settings menu code (default version, a given device will differ):

<一个href="http://android.git.kernel.org/?p=platform/packages/apps/Phone.git;a=blob;f=src/com/android/phone/Settings.java;hb=HEAD" rel="nofollow">http://android.git.kernel.org/?p=platform/packages/apps/Phone.git;a=blob;f=src/com/android/phone/Settings.java;hb=HEAD

编辑:AOSP不再从kernel.org服务。的可浏览镜   目前这款手机存储库是在    https://github.com/android/platform_packages_apps_phone 然而,由于   code组织的演变也不再是Settings.java   那里。有人可能既使用git从重建以上版本   这个仓库,或者试图找出其中的code已迁移   在目前的版本中。

AOSP is no longer served from kernel.org. A browsable mirror of the current phone repository is at https://github.com/android/platform_packages_apps_phone however due to evolution of code organization there is no longer a Settings.java there. One might either use git to reconstruct the version above from this repository, or else try to figure out where the code has migrated to in current releases.

您将需要找出具体实施组要切换NT_MODE_常量。而你需要能够写保护设置,这就要求所用的系统密钥签名。除非它是一个自定义生成,你可能不能够访问这一点。

You would need to find out the implementation specific set of NT_MODE_ constants you wish to toggle between. And you need to be able to write to secure settings, which requires being signed with the system key. Unless it's a custom build, you probably don't have access to that.

这篇关于如何启用/在Android SDK中禁用3G / 2G的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆