i wish to find out the functionality for checking开发者_开发知识库 the default APN... i.e active APN on a handset .
To return only selected APN use:
Cursor c = context.getContentResolver().query(Uri.parse("content://telephony/carriers/preferapn"), null, null, null, null);
To return the entire list of APN use:
Cursor c = context.getContentResolver().query(Uri.parse("content://telephony/carriers/current"), null, null, null, null);
This seems to work:
http://osdir.com/ml/AndroidDevelopers/2009-05/msg03754.html
At least, it worked on my rooted G1 (T-Mobile US) and in the emulator (TelKila).
精彩评论