开发者

To find out the default APN programmatically?

开发者 https://www.devze.com 2023-01-20 01:25 出处:网络
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:

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

精彩评论

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