Access point name manipulation in android
In my android application I need to turn data 开发者_StackOverflow中文版roaming off. Because data roaming is a system preference that can only be read, not written (it belongs to Settings.Secure) , I'm thinking to get the Access Point Names of the phone and change/invalidate them so a data service won't be available when I detect the phone is roaming. I'm thinking it's a good idea and I could obtain the desired behavior but in order to be able to do this I need to know a couple of things first:
1.How to modify an APN ?
2.What field of the APN should be geven a empty value like "", in order to make it unusefull: name ?, proxy? , server ?, APN ?...
3.Which APN should be modified , or all of them should be treated the same way ?.
Thanks
check out http://code.google.com/p/apndroid/ which does exactly what you're looking for: Adding a suffix to an APN-Server, i.e. turning "apn.t-mobile.com" into "apn.t-mobile.comDISABLED".
The sourcecode should answer all your questions.
Hope this helps,
Nick
精彩评论