在 Android 上以编程方式检测和更改数据连接 (GPRS/UMTS)
我知道不幸的是,无法在普通 Android 上以编程方式检测和更改数据连接 (GPRS/UMTS),常见的解决方法是编辑 APN 设置。这并不是一个好的解决方案。
然而,在我的设备(Xperia X10)上,我在“数据漫游”附近有一个附加设置,允许启用或禁用彩信和数据。我想这是索尼爱立信做的个性化设置,也许其他厂商也有类似的东西。有没有办法访问此设置?
I know that unfortunately detecting and changing programmatically data connection (GPRS/UMTS) on vanilla Android is not possible, and the common workaround is to edit APN settings. This is hardly a nice solution.
However on my device (Xperia X10) I have an additional setting near "data roaming", that allows to enable or disable MMS and data. I suppose that this is a personalization made by Sony Ericsson, and maybe even other vendors have something like this. Is there a way to access this setting?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我没有 SE 手机,但我查看了它的系统转储并且:
如果您想向您的 ROM 添加数据连接小部件或类似的东西,那么:
我认为最好修改 Phone.apk,这样它就会捕获启用/禁用数据的特殊意图。它将设置 data_service_key 布尔值并调用 com.android.internal.telephony 中的方法之一。这应该是一件很容易做的事情,然后你将能够非常轻松地创建小部件、应用程序和其他东西 - 他们会使用这种特殊的意图。
I don't have SE phone, but I've looked into its system dump and:
If you want to add data connection widget or something like that to your rom, then:
I think it would be best to modify Phone.apk, so it will catch special intent to enable/disable data. It would set data_service_key boolean and call one of methods from com.android.internal.telephony. This should be quite easy thing to do and then you will be able to create widgets, apps and other stuff very easily - they would use that special intent.
您是否看过SE 开发者专区?我发现它非常有用。
Have you looked at SE developer zone? I found it to be pretty useful.