Based on Nippey's answer, the actual piece of code that worked for me is:
public Boolean isDataRoamingEnabled(Context context) { try { // return true or false if data roaming is enabled or not return Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.DATA_ROAMING) == 1; } catch (SettingNotFoundException e) { // return null if no such settings exist (device with no radio data ?) return null; } }
source share