I think you shouldo the following operations,
1. add “<uses-permission android:name="android.permission.WRITE_APN_SETTINGS"/>” to Application’s AndroidManifest.xml
2. Refer the following codes to setup APN settings by
public static final String PREFERRED_APN_URI =
"content://telephony/carriers/preferapn";
private static final Uri PREFERAPN_URI = Uri.parse(PREFERRED_APN_URI);
public static final String APN_ID = "apn_id";
...
private void setSelectedApnKey(String key) {
ContentResolver resolver = getContentResolver();
ContentValues values = new ContentValues();
values.put(APN_ID, key);
resolver.update(PREFERAPN_URI, values, null, null);
}
....
//select target APN setting by its id (from "Telephony.Carriers.CONTENT_URI")
setSelectedApnKey(targetApnId);
....
FYI