設置APN上網時,大家可能經常遇到這個問題:
爲什麼有時要填寫default有時要填寫supl,而彩信又偏偏要mms?
這個問題留到最後,讓我們看看每個接入點類型的含義:
英文原文來自於Google Android Developers
原文連接:http://developer.android.com/reference/android/net/ConnectivityManager.html
我儘量用通俗易懂的語言來解釋每個類型的含義,若您是開發者,請儘量閱讀英文原文。
1、default
默認網絡連接,當激活時所有數據傳輸都使用該連接,不能與其他網絡連接同時使用
1
2
3
4
5
6
|
-
<span style="color:
rgb(8, 0, 0); font-style: italic; font-weight: bold;">
-
-
-
-
</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;">
-
-
-
-
</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連接同時使用
1
2
3
4
5
6
7
|
-
<span style="color:
rgb(8, 0, 0); font-style: italic; font-weight: bold;">
-
-
-
-
-
</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;">
-
-
-
-
-
</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連接同時使用
1
2
3
4
5
6
7
8
9
|
-
<span style="color:
rgb(8, 0, 0); font-style: italic; font-weight: bold;">
-
-
-
-
-
-
-
</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_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>
-
<span style="color:#880000;font-style: italic; font-weight: bold;">
-
-
-
-
-
-
-
</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連接同時使用
1
2
3
4
5
6
7
8
|
-
<span style="color:
rgb(8, 0, 0); font-style: italic; font-weight: bold;">
-
-
-
-
-
-
</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;">
-
-
-
-
-
-
</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)纔會使用此連接
(這個我也不太懂,翻譯的應該很有問題….)
1
2
3
4
5
6
7
8
9
|
-
<span style="color:
rgb(8, 0, 0); font-style: italic; font-weight: bold;">
-
-
-
-
-
-
-
</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;">
-
-
-
-
-
-
-
</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_MOB
|