I know that, unfortunately, it is not possible to detect and change a software data connection (GPRS / UMTS) on vanilla Android, and a workaround is to change the APN settings. This is hardly a good solution.
However, on my device (Xperia X10) I have an additional setting next to "data roaming", which allows you to enable or disable MMS and data. I believe this is personalization made by Sony Ericsson, and maybe other manufacturers have something like this. Is there any way to access this setting?
source
share