开发者

To find out the default APN programmatically?

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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜