1. 程式人生 > >default、mms、supl、dun、hipri接入點型別的區別

default、mms、supl、dun、hipri接入點型別的區別

設定APN上網時,大家可能經常遇到這個問題:
為什麼有時要填寫default有時要填寫supl,而彩信又偏偏要mms?
這個問題留到最後,讓我們看看每個接入點型別的含義:
英文原文來自於Google Android Developers
原文連線:http://developer.android.com/reference/android/net/ConnectivityManager.html
我儘量用通俗易懂的語言來解釋每個型別的含義,若您是開發者,請儘量閱讀英文原文。

1、default
‍預設網路連線,當啟用時所有資料傳輸都使用該連線,不能與其他網路連線同時使用

/**
  * The Default Mobile 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_MOBILE = 0;

適用場合:絕大部分正常上網時可以使用
2、mms
彩信專用連線,此連線與default類似,用於與載體的多媒體資訊伺服器對話的應用程式,此連線能與default連線同時使用

/**
  * 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.
  */
  public static final int TYPE_MOBILE_MMS = 2;

適用場合:使用彩信服務時,必須有mms型別的接入點,不必選中,應用程式會自動使用此接入點
3、supl
是Secure User Plane Location“安全使用者面定位”的簡寫,此連線與default類似,用於幫助定位裝置與載體的安全使用者面定位伺服器對話的應用程式,此連線能與default連線同時使用

/**
  * 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.
  */
  public static final int TYPE_MOBILE_DUN = 4;

適用場合:需要使用運營商無線熱點的,CMCC、ChinaNet等
5、hipri
高優先順序網路,與default類似,但路由設定不同。
只有當程序訪問移動DNS伺服器,並明確要求使用requestRouteToHost(int, int)才會使用此連線
(這個我也不太懂,翻譯的應該很有問題….)

/**
  * 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}
  */
  public static final int TYPE_MOBILE_HIPRI = 5;

適用場合:我也不知道……

好了,最後教給大家一個一勞永逸的APN設定大法:2個接入點搞定一切
以下內容分運營商的地方我會標註出來,預設以中國聯通3G為例
1、NET接入點
接入點名稱任意
APN:3gnet(移動2g:cmnet 聯通2g:uninet)
接入點型別:default,supl,dun
其他都為空
2、WAP接入點
APN:3gwap(移動2g:cmwap 聯通2g:uniwap)
代理:10.0.0.172
埠:80
mmsc:http://mmsc.myuni.com.cn(此項不區分2G3G,移動:http://mmsc.monternet.com)
彩信代理:10.0.0.172
彩信埠:80
APN型別:default,mms
好了,搞定~
現在我想文章開頭處的問題就不需要再解答了吧?