软件编程
位置:首页>> 软件编程>> Android编程>> android当前apn的状态以及获取方法

android当前apn的状态以及获取方法

  发布时间:2022-06-20 14:52:25 

标签:apn,状态

在绝大多数android机器etc路径下存放一个的apns-conf.xml文件,表示当前机器使用的apn信息通过root机器可以push出来看看,具体路径可以上网搜下


static Uri PREFERRED_APN_URI = Uri.parse("content://telephony/carriers/preferapn");
ContentResolver cResolver = context.getContentResolver();
Cursor cr = cResolver.query(PREFERRED_APN_URI, null, null, null, null);
cr.moveToFirst();
String user = cr.getString(cr.getColumnIndex("user"));
String pass = cr.getString(cr.getColumnIndex("password"));
//然后对获取的用户名和密码做相关处理获取对应的apn状态
0
投稿

猜你喜欢

手机版 软件编程 asp之家 www.aspxhome.com