If you want to read APN for Android 4.2 and more, this is a change. I tested it and it works.
On Android 4.1 and above, use this:
Cursor c = getContentResolver().query(Uri.withAppendedPath(Telephony.Carriers.CONTENT_URI, "current"), null, null, null, null);
And for Android 4.2 and more, use this code:
private static final String[] APN_PROJECTION = { Telephony.Carriers.TYPE,
And this line:
final Cursor apnCursor =SqliteWrapper.query(context, this.context.getContentResolver(), Uri.withAppendedPath(Carriers.CONTENT_URI, "current"), APN_PROJECTION, null, null, null);
SQLiteWrapperClass is hidden (I found this class on the Internet).
import android.database.sqlite.SqliteWrapper;
source share