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?
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.
Have you looked at SE developer zone? I found it to be pretty useful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With