APN(default、mms、supl、dun、hipri接入點類型的區別)

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

1、default
‍默認網絡連接,當激活時所有數據傳輸都使用該連接,不能與其他網絡連接同時使用

1
2
3
4
5
6
  1. <span style="color: rgb(8, 0, 0); font-style: italic; font-weight: bold;">/**
  2.   * The Default Mobile data connection. When active, all data traffic
  3.   * will use this connection by default. Should not coexist with other
  4.   * default connections.
  5.   */</span> 
  6.   <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> 
  1. <span style="color:#880000;font-style: italic; font-weight: bold;">/** 
  2.   * The Default Mobile data connection. When active, all data traffic 
  3.   * will use this connection by default. Should not coexist with other 
  4.   * default connections. 
  5.   */</span>  
  6.   <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連接同時使用

1
2
3
4
5
6
7
  1. <span style="color: rgb(8, 0, 0); font-style: italic; font-weight: bold;">/**
  2.   * An MMS-specific Mobile data connection. This connection may be the
  3.   * same as TYPE_MOBILE but it may be different. This is used
  4.   * by applications needing to talk to the carrier's Multimedia Messaging
  5.   * Service servers. It may coexist with default data connections.
  6.   */</span> 
  7.   <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> 
  1. <span style="color:#880000;font-style: italic; font-weight: bold;">/** 
  2.   * An MMS-specific Mobile data connection. This connection may be the 
  3.   * same as TYPE_MOBILE but it may be different. This is used 
  4.   * by applications needing to talk to the carrier's Multimedia Messaging 
  5.   * Service servers. It may coexist with default data connections. 
  6.   */</span>  
  7.   <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連接同時使用

1
2
3
4
5
6
7
8
9
  1. <span style="color: rgb(8, 0, 0); font-style: italic; font-weight: bold;">/**
  2.   * A SUPL-specific Mobile data connection. This connection may be the
  3.   * same as {@link #TYPEMOBILE} but it may be different. This is used
  4.   * by applications needing to talk to the carrier's Secure User Plane
  5.   * Location servers for help locating the device. It may coexist with
  6.   * default data connections.
  7.   * {@hide}
  8.   */</span> 
  9.   <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_SUPL <span style="color: rgb(51, 153, 51);">=</span> <span style="color: rgb(204, 102, 204);">3</span><span style="color: rgb(51, 153, 51);">;</span> 
  1. <span style="color:#880000;font-style: italic; font-weight: bold;">/** 
  2.   * A SUPL-specific Mobile data connection. This connection may be the 
  3.   * same as {@link #TYPEMOBILE} but it may be different. This is used 
  4.   * by applications needing to talk to the carrier's Secure User Plane 
  5.   * Location servers for help locating the device. It may coexist with 
  6.   * default data connections. 
  7.   * {@hide} 
  8.   */</span>  
  9.   <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連接同時使用

1
2
3
4
5
6
7
8
  1. <span style="color: rgb(8, 0, 0); font-style: italic; font-weight: bold;">/**
  2.   * A DUN-specific Mobile data connection. This connection may be the
  3.   * same as {@link #TYPEMOBILE} but it may be different. This is used
  4.   * by applicaitons performing a Dial Up Networking bridge so that
  5.   * the carrier is aware of DUN traffic. It may coexist with default data
  6.   * connections.
  7.   */</span> 
  8.   <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> 
  1. <span style="color:#880000;font-style: italic; font-weight: bold;">/** 
  2.   * A DUN-specific Mobile data connection. This connection may be the 
  3.   * same as {@link #TYPEMOBILE} but it may be different. This is used 
  4.   * by applicaitons performing a Dial Up Networking bridge so that 
  5.   * the carrier is aware of DUN traffic. It may coexist with default data 
  6.   * connections. 
  7.   */</span>  
  8.   <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)纔會使用此連接
(這個我也不太懂,翻譯的應該很有問題….)

1
2
3
4
5
6
7
8
9
  1. <span style="color: rgb(8, 0, 0); font-style: italic; font-weight: bold;">/**
  2.   * A High Priority Mobile data connection. This connection is typically
  3.   * the same as {@link #TYPEMOBILE} but the routing setup is different.
  4.   * Only requesting processes will have access to the Mobile DNS servers
  5.   * and only IP's explicitly requested via {@link #requestRouteToHost}
  6.   * will route over this interface.
  7.   *{@hide}
  8.   */</span> 
  9.   <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> 
  1. <span style="color:#880000;font-style: italic; font-weight: bold;">/** 
  2.   * A High Priority Mobile data connection. This connection is typically 
  3.   * the same as {@link #TYPEMOBILE} but the routing setup is different. 
  4.   * Only requesting processes will have access to the Mobile DNS servers 
  5.   * and only IP's explicitly requested via {@link #requestRouteToHost} 
  6.   * will route over this interface. 
  7.   *{@hide} 
  8.   */</span>  
  9.   <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_MOB
發佈了34 篇原創文章 · 獲贊 22 · 訪問量 48萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章