工作一年了,好久没来,默默地当颗小螺丝钉。今天借此机会把学习的写一下,记录下。最近工作在交接,正好总结回顾,这一年,主要和三个字母打交道A,P,N。
APN概述:
APN
APN配置的时候,出现的type的值主要有:default,mms,supl,dun。Default常用于一般的数据业务,主要有internet,wap,web.mms类型用于彩信接收发送的业务;supl用于gprs上网;dun用于wifi等上网类型。
配置时注意事项:
1、在合入完成之后注意检查authtype=”
2、Type=””这个也不能为空,需求有时会省略它的配置,apn的Type=””值主要分为default,*,mms,
3、注释的错误,在xml文件中,注释的格式为如
4、mcc和mnc一般合起来为五位,其中mnc的位数为2,如果出现个位数应该自动补全,如1,补为01。
5、如果需求中存在Authentication:normal。说明没有用户名和密码的话,这个鉴权是不需要的。
6、注意检查wap和web一般不涉及彩信等相关端口的配置,没有mmsport,mmsproxy..注意端口写正确。
7、关于authtype,
authtype这一项未填写,不管有无用户名,会自动默认为PAP
8、dun类型的apn
如果没有dun类型的apn,默认用default的。dun后面加上default,是为了在tethering模式下可以进行下载操作。目前很多需求上明确写明只有dun,则按照需求处理。
检查方法:
1、验证其语法的正确性,可以直接双击用浏览器自带的编译xml检查其语法格式的正确性,不正确的会在浏览器末尾报错。
2、验证其读取的正确性:
请将配置文件替换到手机,验证一下配置文件的正确性:
方法:adb
然后在apnsetting界面
3、修改手机预设apn的方法:
预设的文件在手机的
文件名字叫
然后到apn设置的界面去,恢复下默认设置,这个预设的就没有了,就可以手动设置了。
常见故障:
1、开发故障,APN没有拷贝在手机中
故障描述:
故障分析:发现已经有APN文件,但是在版本中却没有发现相应的文件合入,检查
在相应的编译文件中分析是否有APN配置文件的添加语句。
代码修改:在项目分支APN文件所在目录下
app\ZTE_CUSTOM\XXX\android\device\zte\products\XXX.mk中添加语句:
PRODUCT_COPY_FILES
就可保证相应的APN文件添加到手机中。
2、自测,APN文件读取失败
故障描述:自测时,push
APN列表为空,说明APN文件读取失败。
故障分析:APN文件参数配置错误,导致读取失败,可能的原因有
代码修改:检查1、authtype若无需求,则不在配置表中列出该项,即不可以出现authtype
3、前方故障,APN参数错误导致彩信无法发送
故障描述:彩信无法发送,但可以成功接收
故障分析:APN文件参数配置错误,注意检查彩信涉及的相关端口配置
mmsport,mmsproxy是否正确
代码修改:与需求工程师核对apn需求,若不确定参数正确与否,可请前方测试人员在局方网络下使用对比机对比,参考其apn配置,进行修改。
4、前方故障,APN参数Authentication前方实测与需求不符
故障描述:前方测试,APN参数中authtype项实际为PAP
故障分析:当需求中存在签权项Authentication:
代码修改:Authentication参数值在需求文件中写为
5、定制需求,漫游时,仍使用原卡MCC/MNC匹配的APN参数
故障描述:当设备漫游到其它网络时,仍然使用卡中原MNC/MCC对应的APN设置
代码修改:SIMRecords.java文件中,一般情况下,operator
6、前方故障,无法自动激活APN列表中的默认APN选项
故障描述:首次开机后,APN列表正常显示,但无法自动激活默认APN;手动激活后,再次开机则可正常激活。
故障分析:该项目APN需求中,有两组MCC/MNC号相同的APN配置,需要通过spn参数进行区别。通过匹配卡中读出的spn参数和APN配置文件中的spn进行默认APN的选择。而出错项目中,需求spn参数与实际不符,导致无法正常匹配,默认APN无法激活。
代码修改:请前方测试人员提供日志,确认正确的spn参数,修改APN配置文件。
目前代码增加了根据spn值进行APN匹配的功能,类似APN,将从卡中读取的spn保存在PREFERSPN_URI.
createAllApnList()代码中,若mSelectSpn
接着在buildWaitingApns()中,将卡中读出的spn参数值和APN配置表中读出的spn参数值进行比较,匹配spn相同的Apn配置作为waitingApn。
7、定制需求,APN子网过滤功能
故障描述:当一张卡有多组APN时,除了用SPN区分外,需求要求通过子网(subnet)来区分,实现APN的子网过滤。
故障分析:从卡中读取子网号码:IMSI
代码修改:
SIMRecord.java中读取subnet值,并设置接口property名字为”gsm.operator.numeric.subnet”。
8、前方故障,在丢失pdp后无法自动恢复,必须手动关闭再打开数据业务后才能恢复。
故障描述:在P743VV项目中,接到外籍投诉,手机上网状态,当转移到信号较弱的地方,会失去数据链接,如果回到信号较强的地方后,无法自动回复数据链接,必须手动关闭再打开才能恢复。
故障分析:该项目在国内虽然没有复现,但是外籍复现此故障的概率较高,分析日志,发现在丢失后没有自动进行重新连接。
代码修改:分析日志,出现这句话:“onDataSetupComplete:
的GsmDataConnectionTracker
9、数据连接图标显示有误
跟踪了代码,打了LOG,编译了framwork.发现在框架层Phonestatelistener.java里面走到了case
***********************************************************************************************************************************
***********************************************************************************************************************************
APN(default、mms、supl、dun、hipri接入点类型的区别)
设置APN上网时,大家可能经常遇到这个问题:
为什么有时要填写default有时要填写supl,而彩信又偏偏要mms?
这个问题留到最后,让我们看看每个接入点类型的含义:
英文原文来自于Google Android Developers
原文连接:http://developer.android.com/reference/android/net/ConnectivityManager.html
我尽量用通俗易懂的语言来解释每个类型的含义,若您是开发者,请尽量阅读英文原文。
默认网络连接,当激活时所有数据传输都使用该连接,不能与其他网络连接同时使用
<span style="color: rgb(8, 0, 0); font-style: italic; font-weight: bold;">/**
* The Default Mobile data connection. When active, all data traffic
* will use this connection by default. Should not coexist with other
* default connections.
*/</span>
<span style="color: rgb(0, 0, 0); font-weight: bold;">public</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">static</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">final</span> <span style="color: rgb(0, 102, 0); font-weight: bold;">int</span> TYPE_MOBILE <span style="color: rgb(51, 153, 51);">=</span> <span style="color: rgb(204, 102, 204);">0</span><span style="color: rgb(51, 153, 51);">;</span>
<span style="color:#880000;font-style: italic; font-weight: bold;">/**
* The Default Mobile data connection. When active, all data traffic
* will use this connection by default. Should not coexist with other
* default connections.
*/</span>
<span style="color:#000000;font-weight: bold;">public</span> <span style="color:#000000;font-weight: bold;">static</span> <span style="color:#000000;font-weight: bold;">final</span> <span style="color:#0660;font-weight: bold;">int</span> TYPE_MOBILE <span style="color:#339933;">=</span> <span style="color:#cc66cc;">0</span><span style="color:#339933;">;</span>
适用场合:绝大部分正常上网时可以使用
2、mms
彩信专用连接,此连接与default类似,用于与载体的多媒体信息服务器对话的应用程序,此连接能与default连接同时使用
<span style="color: rgb(8, 0, 0); font-style: italic; font-weight: bold;">/**
* An MMS-specific Mobile data connection. This connection may be the
* same as TYPE_MOBILE 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.
*/</span>
<span style="color: rgb(0, 0, 0); font-weight: bold;">public</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">static</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">final</span> <span style="color: rgb(0, 102, 0); font-weight: bold;">int</span> TYPE_MOBILE_MMS <span style="color: rgb(51, 153, 51);">=</span> <span style="color: rgb(204, 102, 204);">2</span><span style="color: rgb(51, 153, 51);">;</span>
<span style="color:#880000;font-style: italic; font-weight: bold;">/**
* An MMS-specific Mobile data connection. This connection may be the
* same as TYPE_MOBILE 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.
*/</span>
<span style="color:#000000;font-weight: bold;">public</span> <span style="color:#000000;font-weight: bold;">static</span> <span style="color:#000000;font-weight: bold;">final</span> <span style="color:#0660;font-weight: bold;">int</span> TYPE_MOBILE_MMS <span style="color:#339933;">=</span> <span style="color:#cc66cc;">2</span><span style="color:#339933;">;</span>
适用场合:使用彩信服务时,必须有mms类型的接入点,不必选中,应用程序会自动使用此接入点
3、supl
是Secure User Plane Location“安全用户面定位”的简写,此连接与default类似,用于帮助定位设备与载体的安全用户面定位服务器对话的应用程序,此连接能与default连接同时使用
<span style="color: rgb(8, 0, 0); font-style: italic; font-weight: bold;">/**
* 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}
*/</span>
<span style="color: rgb(0, 0, 0); font-weight: bold;">public</span> <span style="color: rgb(0, 0, 0); font-weight:
<span style="color:#880000;font-style: italic; font-weight: bold;">/**
* 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}
*/</span>
<span style="color:#000000;font-weight: bold;">public</span> <span style="color:#000000;font-weight: bold;">static</span> <span style="color:#000000;font-weight: bold;">final</span> <span style="color:#0660;font-weight: bold;">int</span> TYPE_MOBILE_SUPL <span style="color:#339933;">=</span> <span style="color:#cc66cc;">3</span><span style="color:#339933;">;</span>
适用场合:需要自动切换wap与net接入点的、需要把手机当临时AP的
对SUPL技术感兴趣的朋友,不妨看下以下文章
SUPL技术(一)http://blog.sina.com.cn/s/blog_537f4a11010008tw.html
SUPL技术(二)http://blog.sina.com.cn/s/blog_537f4a11010008uf.html
SUPL技术(三)http://blog.sina.com.cn/s/blog_537f4a11010008ws.html
SUPL技术(四)http://blog.sina.com.cn/s/blog_537f4a11010008yf.html
4、dun
Dial Up Networking拨号网络的简称,此连接与default连接类似,用于执行一个拨号网络网桥,使载体能知道拨号网络流量的应用程序,此连接能与default连接同时使用
<span style="color: rgb(8, 0, 0); font-style: italic; font-weight: bold;">/**
* 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.
*/</span>
<span style="color: rgb(0, 0, 0); font-weight: bold;">public</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">static</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">final</span> <span style="color: rgb(0, 102, 0); font-weight: bold;">int</span> TYPE_MOBILE_DUN <span style="color: rgb(51, 153, 51);">=</span> <span style="color: rgb(204, 102, 204);">4</span><span style="color: rgb(51, 153, 51);">;</span>
<span style="color:#880000;font-style: italic; font-weight: bold;">/**
* 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.
*/</span>
<span style="color:#000000;font-weight: bold;">public</span> <span style="color:#000000;font-weight: bold;">static</span> <span style="color:#000000;font-weight: bold;">final</span> <span style="color:#0660;font-weight: bold;">int</span> TYPE_MOBILE_DUN <span style="color:#339933;">=</span> <span style="color:#cc66cc;">4</span><span style="color:#339933;">;</span>
适用场合:需要使用运营商无线热点的,CMCC、ChinaNet等
5、hipri
高优先级网络,与default类似,但路由设置不同。
只有当进程访问移动DNS服务器,并明确要求使用requestRouteToHost(int, int)才会使用此连接
(这个我也不太懂,翻译的应该很有问题….)
<span style="color: rgb(8, 0, 0); font-style: italic; font-weight: bold;">/**
* 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}
* will route over this interface.
*{@hide}
*/</span>
<span style="color: rgb(0, 0, 0); font-weight: bold;">public</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">static</span> <span style="color: rgb(0, 0, 0); font-weight: bold;">final</span> <span style="color: rgb(0, 102, 0); font-weight: bold;">int</span> TYPE_MOBILE_HIPRI <span style="color: rgb(51, 153, 51);">=</span> <span style="color: rgb(204, 102, 204);">5</span><span style="color: rgb(51, 153, 51);">;</span>
<span style="color:#880000;font-style: italic; font-weight: bold;">/**
* 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}
* will route over this interface.
*{@hide}
*/</span>
<span style="color:#000000;font-weight: bold;">public</span> <span style="color:#000000;font-weight: bold;">static</span> <span style="color:#000000;font-weight: bold;">final</span> <span style="color:#0660;font-weight: bold;">int</span> TYPE_MOBILE_HIPRI <span style="color:#339933;">=</span> <span style="color:#cc
转自: http://blog.csdn.net/dy_learning/article/details/10900467
http://www.myexception.cn/mobile/1454823.html