没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Android network 2011-01-28
系统中对网络的判断和选在是在Connectivityervice这个服务中来处理的,在系统启动的时候会启动这个系统服务:
系统启动完毕后,ConnectivityService在系统启动的时候就启动了。
在android内部,用framework/base/core/res/res/values/config.xml中定义了网络的类型:
<string-array translatable="false" name="networkAttributes">
<item>"default,wifi,0"</item>
<item>"default,mobile,0"</item>
<item>"mms,mobile,1"</item>
<item>"supl,mobile,1"</item>
<item>"dun,mobile,1"</item>
<item>"hipri,mobile,2"</item>
</string-array>
<string-array translatable="false" name="radioAttributes">
<item>"wifi,1,1"</item>
<item>"mobile,0,1"</item>
</string-array>
ConnectivityManager定义了向对应的字符串常量:
public static final int TYPE_MOBILE = 0;
/**
* The Default WIFI data connection. When active, all data traffic
* will use this connection by default. Should not coexist with other
* default connections.
*/
public static final int TYPE_WIFI = 1;
/**
系统中对网络的判断和选在是在Connectivityervice这个服务中来处理的,在系统启动的时候会启动这个系统服务:
系统启动完毕后,ConnectivityService在系统启动的时候就启动了。
在android内部,用framework/base/core/res/res/values/config.xml中定义了网络的类型:
<string-array translatable="false" name="networkAttributes">
<item>"default,wifi,0"</item>
<item>"default,mobile,0"</item>
<item>"mms,mobile,1"</item>
<item>"supl,mobile,1"</item>
<item>"dun,mobile,1"</item>
<item>"hipri,mobile,2"</item>
</string-array>
<string-array translatable="false" name="radioAttributes">
<item>"wifi,1,1"</item>
<item>"mobile,0,1"</item>
</string-array>
ConnectivityManager定义了向对应的字符串常量:
public static final int TYPE_MOBILE = 0;
/**
* The Default WIFI data connection. When active, all data traffic
* will use this connection by default. Should not coexist with other
* default connections.
*/
public static final int TYPE_WIFI = 1;
/**
* An MMS-specific Mobile data connection. This connection may be the
* same as {@link #TYPEMOBILE} but it may be different. This is used
* by applications needing to talk to the carrier's Multimedia Messaging
* Service servers. It may coexist with default data connections.
* {@hide}
*/
public static final int TYPE_MOBILE_MMS = 2;
/**
* A SUPL-specific Mobile data connection. This connection may be the
* same as {@link #TYPEMOBILE} but it may be different. This is used
* by applications needing to talk to the carrier's Secure User Plane
* Location servers for help locating the device. It may coexist with
* default data connections.
* {@hide}
*/
public static final int TYPE_MOBILE_SUPL = 3;
/**
* A DUN-specific Mobile data connection. This connection may be the
* same as {@link #TYPEMOBILE} but it may be different. This is used
* by applicaitons performing a Dial Up Networking bridge so that
* the carrier is aware of DUN traffic. It may coexist with default data
* connections.
* {@hide}
*/
public static final int TYPE_MOBILE_DUN = 4;
/**
* A High Priority Mobile data connection. This connection is typically
* the same as {@link #TYPEMOBILE} but the routing setup is different.
* Only requesting processes will have access to the Mobile DNS servers
* and only IP's explicitly requested via {@link #requestRouteToHost}
* same as {@link #TYPEMOBILE} but it may be different. This is used
* by applications needing to talk to the carrier's Multimedia Messaging
* Service servers. It may coexist with default data connections.
* {@hide}
*/
public static final int TYPE_MOBILE_MMS = 2;
/**
* A SUPL-specific Mobile data connection. This connection may be the
* same as {@link #TYPEMOBILE} but it may be different. This is used
* by applications needing to talk to the carrier's Secure User Plane
* Location servers for help locating the device. It may coexist with
* default data connections.
* {@hide}
*/
public static final int TYPE_MOBILE_SUPL = 3;
/**
* A DUN-specific Mobile data connection. This connection may be the
* same as {@link #TYPEMOBILE} but it may be different. This is used
* by applicaitons performing a Dial Up Networking bridge so that
* the carrier is aware of DUN traffic. It may coexist with default data
* connections.
* {@hide}
*/
public static final int TYPE_MOBILE_DUN = 4;
/**
* A High Priority Mobile data connection. This connection is typically
* the same as {@link #TYPEMOBILE} but the routing setup is different.
* Only requesting processes will have access to the Mobile DNS servers
* and only IP's explicitly requested via {@link #requestRouteToHost}
剩余15页未读,继续阅读
sunxingzhesunjinbiao
- 粉丝: 78
- 资源: 27
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页