0

How to know whether Roaming Data is Enabled/Disabled? In the code i need to know whether Data Roaming is enabled. I can check whether phone is roaming via TelephonyManager. But how to know if Data Roaming is enabled?

Taras
  • 488
  • 6
  • 21

1 Answers1

0
        NetworkInfo info = (NetworkInfo) ((ConnectivityManager) ctx
            .getSystemService(Context.CONNECTIVITY_SERVICE)).getActiveNetworkInfo();
if(info.isRoaming)
{
S.O.P("data roaming");
}
Kamal
  • 1,415
  • 13
  • 24
  • This actually returns true even if data roaming is turned off. Further more this approach might return the WIFI NetworkInfo object if the user is connected to a WiFi network at that time. –  Jan 26 '12 at 08:56
  • 1
    this tells you if you are currently roaming, not if roaming is enabled. – Jeffrey Blattman Feb 14 '12 at 23:43
  • @jaffery: yes this tells you if you are currently in Roaming. But you can use another condition for data is enabled or not. Its easy & a developer can think it itself. – Kamal May 29 '12 at 12:42