2、源码:apns-conf.xml来自apns-full-conf.xml,编译系统的时候Copy到/system/etc/目录下:
[html] view plain copy print?
PRODUCT_COPY_FILES +=
device/sample/etc/apns-full-conf.xml:system/etc/apns-conf.xml
APN加载过程
1、系统检查到SIM卡正常后从/system/etc/apns-conf.xml解析数据,存放到数据库:telephony.db
[html] view plain copy print?
/data/data/com.android.providers.telephony/databases/telephony.db
sqlite>select * from carriers where numeric='46001'
1113|China Unicom 3G|46001|460|01|3gnet|||||80||||-1|default,supl|1|IP|IP|1|0||
1114|中国联通 3g 彩信 (China Unicom)|46001|460|01|3gwap||||||10.0.0.172|80|http://mmsc.myuni.com.cn|-1|mms|1|IP|IP|1|0||
1115|China Unicom MMS|46001|460|01|uniwap||||||10.0.0.172|80|
telephony.db数据库的建立对应TelephonyProvider.Java文件:
[java] view plain copy print?
packages\providers\telephonyprovider\src\com\android\providers\telephony\TelephonyProvider.java
public class TelephonyProvider extends ContentProvider{
private static final String DATABASE_NAME = "telephony.db"
private static class DatabaseHelper extends SQLiteOpenHelper {
public DatabaseHelper(Context context) {
super(context, DATABASE_NAME, null, getVersion(context))
mContext = context
}
@Override
public void onCreate(SQLiteDatabase db) {
// Set up the database schema
db.execSQL("CREATE TABLE " + CARRIERS_TABLE +
"(_id INTEGER PRIMARY KEY," +
"name TEXT," +
"numeric TEXT," +
"mcc TEXT," +
"mnc TEXT," +
"apn TEXT," +
"user TEXT," +
"server TEXT," +
"password TEXT," +
"proxy TEXT," +
"port TEXT," +
"mmsproxy TEXT," +
"mmsport TEXT," +
"mmsc TEXT," +
"authtype INTEGER," +
"type TEXT," +
"current INTEGER," +
"protocol TEXT," +
"roaming_protocol TEXT," +
"carrier_enabled BOOLEAN," +
"bearer INTEGER," +
"mvno_type TEXT," +
"mvno_match_data TEXT)")
initDatabase(db)
}
private void initDatabase(SQLiteDatabase db) {
// Read internal APNS data
// Environment.getRootDirectory() is a fancy way of saying ANDROID_ROOT or "/system".
File confFile = new File(Environment.getRootDirectory(), PARTNER_APNS_PATH)
loadApns(db, confparser)
}
}
}
手机参数:APN(接入点、访问点):3gwap/3GWAP,代理服务器地址:10.0.0.172,端口:80。温馨提示:由于各款手机设置参数的方法不尽相同,详情您可参考手机说明书设置。如需帮助,可联系当地人工客服协助设置。
我列出的是最全的版本。。\x0d\x0a设置前最好把"菜单-设置-无线控件-移动网络设置-接入点名称"中的APN全部删除。\x0d\x0a首先待机情况下-菜单-设置-无线控件-移动网络设置-接入点名称\x0d\x0a进去以后,按MENU "新APN"\x0d\x0a一、 名称:CMWAP (这个名字不重要,叫什么都行)\x0d\x0aAPN:cmwap\x0d\x0a代理:010.000.000.172 (注意是三位数的)\x0d\x0a端口:80\x0d\x0aMCC:460\x0d\x0aMNC:00\x0d\x0aAPN类型:default (这个要自己输入的)\x0d\x0a按MENU保存\x0d\x0a二、 名称:CMNET设置 (这个名字不重要,叫什么都行)\x0d\x0aAPN:cmnet\x0d\x0aMCC:460\x0d\x0aMNC:00\x0d\x0aAPN类型:default (这个要自己输入的)\x0d\x0a按MENU保存\x0d\x0a三、 名称:彩信\x0d\x0aAPN:cmwap(这个名字不重要,叫什么都行)\x0d\x0aMMSC:mmsc.monternet.com(不能有http://出现,要直接写网址)\x0d\x0a彩信代理:010.000.000.172 (注意是三位数的)\x0d\x0a彩信端口:80\x0d\x0aMCC:460\x0d\x0aMNC:00\x0d\x0aAPN类型:mms (这个要自己输入的)\x0d\x0a按MENU保存\x0d\x0a最终说明:\x0d\x0a\x0d\x0a1、没写的地方不用设置。\x0d\x0a2、最好先把WIFI关掉。\x0d\x0a3、全部设置完后,接入点名称下能看到这3个设置项,点击激活CMWAP。这时如果出现绿色的小E和上下两上箭头,就设置成功了。如果不行就照 下面的做:\x0d\x0a说明一下:“激活CMWAP的话QQ 和UCWEB可以用,激活CMNET,自带浏览器和android市场就正常工作了。\x0d\x0a4、上面的都设置完后,进入手机拨号:输入*#*#4636#*#*——点“手机信息”——拉倒屏幕最下面找到“切换DNS”,并点击它,旁边显示会 “0.0.0.0 allowed”,到这步就算OK啦。冲浪去吧!\x0d\x0a5、理论上这个设置在android是通用的。测试机器G4 TATTOO,版本Android1.6。欢迎分享,转载请注明来源:内存溢出
评论列表(0条)