Hello guys,
I'm working on a project that I need to know whether the device is on
roaming or not. I've been digging until the very last page of Google
without success, I haven't found any sample code of how to accomplish
that.
This is the far that I could go:
ServiceState ss = new ServiceState();
Log.i(TAG, "roaming 1: " + ss.getRoaming());
Log.i(TAG, "roaming 2: " + ss.getOperatorAlphaLong());
Log.i(TAG, "roaming 3: " + ss.getOperatorAlphaShort());
Log.i(TAG, "roaming 4: " + ss.getOperatorNumeric());
Log.i(TAG, "roaming 5: " + ss.getState());
and it results:
roaming 1: false
roaming 2: null
roaming 3: null
roaming 4: null
roaming 5: 1
I have no idea what the snippet bellow is for, but I decided to add it
into my Manifest file just in case:
<uses-permission
android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission
android:name="android.permission.ACCESS_COARSE_UPDATES" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" /
>
Can any of you guys help me on this one?
PS: I'm testing it on my Droid, and I've got plenty of SIM Cards from
other countries and cities so that I can get the roaming status to be
on.
Regards
-gustavo
I'm working on a project that I need to know whether the device is on
roaming or not. I've been digging until the very last page of Google
without success, I haven't found any sample code of how to accomplish
that.
This is the far that I could go:
ServiceState ss = new ServiceState();
Log.i(TAG, "roaming 1: " + ss.getRoaming());
Log.i(TAG, "roaming 2: " + ss.getOperatorAlphaLong());
Log.i(TAG, "roaming 3: " + ss.getOperatorAlphaShort());
Log.i(TAG, "roaming 4: " + ss.getOperatorNumeric());
Log.i(TAG, "roaming 5: " + ss.getState());
and it results:
roaming 1: false
roaming 2: null
roaming 3: null
roaming 4: null
roaming 5: 1
I have no idea what the snippet bellow is for, but I decided to add it
into my Manifest file just in case:
<uses-permission
android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission
android:name="android.permission.ACCESS_COARSE_UPDATES" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" /
>
Can any of you guys help me on this one?
PS: I'm testing it on my Droid, and I've got plenty of SIM Cards from
other countries and cities so that I can get the roaming status to be
on.
Regards
-gustavo