WEB开发网
开发学院手机开发Android 开发 开关Android的APN网络的实现 阅读

开关Android的APN网络的实现

 2010-08-21 06:20:00 来源:WEB开发网   
核心提示://3gwap 3gnet uniwap uninet/*** 3G wap 中国联通3gwap APN*/public static String GWAP_3 = "3gwap";/*** 3G net 中国联通3gnet APN*/public static String GNET_3=&qu

//3gwap 3gnet uniwap uninet

/**

* 3G wap 中国联通3gwap APN

*/

public static String GWAP_3 = "3gwap";

/**

* 3G net 中国联通3gnet APN

*/

public static String GNET_3="3gnet";

/**

* uni wap 中国联通uni wap APN

*/

public static String UNIWAP="uniwap";

/**

* uni net 中国联通uni net APN

*/

public static String UNINET="uninet";

}

public static String matchAPN(String currentName) {

if("".equals(currentName) || null==currentName){

return "";

}

currentName = currentName.toLowerCase();

if(currentName.startsWith(APNNet.CMNET))

return APNNet.CMNET;

else if(currentName.startsWith(APNNet.CMWAP))

return APNNet.CMWAP;

else if(currentName.startsWith(APNNet.GNET_3))

return APNNet.GNET_3;

else if(currentName.startsWith(APNNet.GWAP_3))

return APNNet.GWAP_3;

else if(currentName.startsWith(APNNet.UNINET))

return APNNet.UNINET;

else if(currentName.startsWith(APNNet.UNIWAP))

return APNNet.UNIWAP;

else if(currentName.startsWith("default"))

return "default";

else return "";

// return currentName.substring(0, currentName.length() - SUFFIX.length());

}

}

package cc.mdev.apn;

/**

* 呃彦是APN匹配,用於匹配移?或者?通的APN

* @author SinFrancis wong

* @site http://mdev.cc

* @wiki http://mdev.cc/wiki

* @since 2010-01-08

*

*/

public final class APNMatchTools {

public static class APNNet{

/**

* 中国移动cmwap

*/

public static String CMWAP = "cmwap";

上一页  1 2 3 4 5 6  下一页

Tags:开关 Android APN

编辑录入:coldstar [复制链接] [打 印]
赞助商链接