## 本節引言:
說到GPS這個名詞,相信大家都不陌生,GPS全球定位技術嘛,嗯,Android中定位的方式 一般有這四種:GPS定位,WIFI定準,基站定位,AGPS定位(基站+GPS);
本系列教程只講解GPS定位的基本使用!GPS是通過與衛星交互來獲取設備當前的經緯度,準確 度較高,但也有一些缺點,最大的缺點就是:**室內幾乎無法使用**...需要收到4顆衛星或以上 信號才能保證GPS的準確定位!但是假如你是在室外,無網絡的情況,GPS還是可以用的!
本節我們就來探討下Android中的GPS的基本用法~
* * *
## 1.定位相關的一些API
* * *
### **1)LocationManager**
官方API文檔:[LocationManager](http://androiddoc.qiniudn.com/reference/android/location/LocationManager.html)
這玩意是系統服務來的,不能直接new,需要:
~~~
LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
~~~
另外用GPS定位別忘了加權限:
~~~
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
~~~
好的,獲得了LocationManager對象后,我們可以調用下面這些常用的方法:
* **addGpsStatusListener**(GpsStatus.Listener listener):添加一個GPS狀態監聽器
* **addProximityAlert**(double latitude, double longitude, float radius, long expiration, PendingIntent intent): 添加一個臨界警告
* **getAllProviders**():獲取所有的LocationProvider列表
* **getBestProvider**(Criteria criteria, boolean enabledOnly):根據指定條件返回最優LocationProvider
* **getGpsStatus**(GpsStatus status):獲取GPS狀態
* **getLastKnownLocation**(String provider):根據LocationProvider獲得最近一次已知的Location
* **getProvider**(String name):根據名稱來獲得LocationProvider
* **getProviders**(boolean enabledOnly):獲取所有可用的LocationProvider
* **getProviders**(Criteria criteria, boolean enabledOnly):根據指定條件獲取滿足條件的所有LocationProvider
* **isProviderEnabled**(String provider):判斷指定名稱的LocationProvider是否可用
* **removeGpsStatusListener**(GpsStatus.Listener listener):刪除GPS狀態監聽器
* **removeProximityAlert**(PendingIntent intent):刪除一個臨近警告
* **requestLocationUpdates**(long minTime, float minDistance, Criteria criteria, PendingIntent intent): 通過制定的LocationProvider周期性地獲取定位信息,并通過Intent啟動相應的組件
* **requestLocationUpdates**(String provider, long minTime, float minDistance, LocationListener listener): 通過制定的LocationProvider周期性地獲取定位信息,并觸發listener所對應的觸發器
* * *
### **2)LocationProvider(定位提供者)**
官方API文檔:[LocationProvider](http://androiddoc.qiniudn.com/reference/android/location/LocationProvider.html)
這比是GPS定位組件的抽象表示,調用下述方法可以獲取該定位組件的相關信息!
常用的方法如下:
* **getAccuracy**():返回LocationProvider精度
* **getName**():返回LocationProvider名稱
* **getPowerRequirement**():獲取LocationProvider的電源需求
* **hasMonetaryCost**():返回該LocationProvider是收費還是免費的
* **meetsCriteria**(Criteria criteria):判斷LocationProvider是否滿足Criteria條件
* **requiresCell**():判斷LocationProvider是否需要訪問網絡基站
* **requiresNetwork**():判斷LocationProvider是否需要訪問網絡數據
* **requiresSatellite**():判斷LocationProvider是否需要訪問基于衛星的定位系統
* **supportsAltitude**():判斷LocationProvider是否支持高度信息
* **supportsBearing**():判斷LocationProvider是否支持方向信息
* **supportsSpeed**():判斷是LocationProvider否支持速度信息
* * *
### **3)Location(位置信息)**
官方API文檔:[Location](http://androiddoc.qiniudn.com/reference/android/location/Location.html)
位置信息的抽象類,我們可以調用下述方法獲取相關的定位信息!
常用方法如下:
* float?**getAccuracy**():獲得定位信息的精度
* double?**getAltitude**():獲得定位信息的高度
* float?**getBearing**():獲得定位信息的方向
* double?**getLatitude**():獲得定位信息的緯度
* double?**getLongitude**():獲得定位信息的精度
* String?**getProvider**():獲得提供該定位信息的LocationProvider
* float?**getSpeed**():獲得定位信息的速度
* boolean?**hasAccuracy**():判斷該定位信息是否含有精度信息
* * *
### **4)Criteria(過濾條件)**
官方API文檔:[Criteria](http://androiddoc.qiniudn.com/reference/android/location/Criteria.html)
獲取LocationProvider時,可以設置過濾條件,就是通過這個類來設置相關條件的~
常用方法如下:
* **setAccuracy**(int accuracy):設置對的精度要求
* **setAltitudeRequired**(boolean altitudeRequired):設置是否要求LocationProvider能提供高度的信息
* **setBearingRequired**(boolean bearingRequired):設置是否要LocationProvider求能提供方向信息
* **setCostAllowed**(boolean costAllowed):設置是否要求LocationProvider能提供方向信息
* **setPowerRequirement**(int level):設置要求LocationProvider的耗電量
* **setSpeedRequired**(boolean speedRequired):設置是否要求LocationProvider能提供速度信息
* * *
## 2.獲取LocationProvider的例子
**運行效果圖**:

由圖可以看到,當前可用的LocationProvider有三個,分別是:
* **passive**:被動提供,由其他程序提供
* **gps**:通過GPS獲取定位信息
* **network**:通過網絡獲取定位信息
**實現代碼**:
布局文件:**activity_main.xml**:
~~~
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:id="@+id/btn_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="獲得系統所有的LocationProvider" />
<Button
android:id="@+id/btn_two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="根據條件獲取LocationProvider" />
<Button
android:id="@+id/btn_three"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="獲取指定的LocationProvider" />
<TextView
android:id="@+id/tv_result"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:background="#81BB4D"
android:padding="5dp"
android:textColor="#FFFFFF"
android:textSize="20sp"
android:textStyle="bold" />
</LinearLayout>
~~~
MainActivity.java:
~~~
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
private Button btn_one;
private Button btn_two;
private Button btn_three;
private TextView tv_result;
private LocationManager lm;
private List<String> pNames = new ArrayList<String>(); // 存放LocationProvider名稱的集合
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
bindViews();
}
private void bindViews() {
btn_one = (Button) findViewById(R.id.btn_one);
btn_two = (Button) findViewById(R.id.btn_two);
btn_three = (Button) findViewById(R.id.btn_three);
tv_result = (TextView) findViewById(R.id.tv_result);
btn_one.setOnClickListener(this);
btn_two.setOnClickListener(this);
btn_three.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_one:
pNames.clear();
pNames = lm.getAllProviders();
tv_result.setText(getProvider());
break;
case R.id.btn_two:
pNames.clear();
Criteria criteria = new Criteria();
criteria.setCostAllowed(false); //免費
criteria.setAltitudeRequired(true); //能夠提供高度信息
criteria.setBearingRequired(true); //能夠提供方向信息
pNames = lm.getProviders(criteria, true);
tv_result.setText(getProvider());
break;
case R.id.btn_three:
pNames.clear();
pNames.add(lm.getProvider(LocationManager.GPS_PROVIDER).getName()); //指定名稱
tv_result.setText(getProvider());
break;
}
}
//遍歷數組返回字符串的方法
private String getProvider(){
StringBuilder sb = new StringBuilder();
for (String s : pNames) {
sb.append(s + "\n");
}
return sb.toString();
}
}
~~~
* * *
## 3.判斷GPS是否打開以及打開GPS的兩種方式
在我們使用GPS定位前的第一件事應該是去判斷GPS是否已經打開或可用,沒打開的話我們需要去 打開GPS才能完成定位!這里不考慮AGPS的情況~
* * *
### **1)判斷GPS是否可用**
~~~
private boolean isGpsAble(LocationManager lm){
return lm.isProviderEnabled(android.location.LocationManager.GPS_PROVIDER)?true:false;
}
~~~
* * *
### **2)檢測到GPS未打開,打開GPS**
**方法一**:強制打開GPS,Android 5.0后無用....
~~~
//強制幫用戶打開GPS 5.0以前可用
private void openGPS(Context context){
Intent gpsIntent = new Intent();
gpsIntent.setClassName("com.android.settings", "com.android.settings.widget.SettingsAppWidgetProvider");
gpsIntent.addCategory("android.intent.category.ALTERNATIVE");
gpsIntent.setData(Uri.parse("custom:3"));
try {
PendingIntent.getBroadcast(LocationActivity.this, 0, gpsIntent, 0).send();
} catch (PendingIntent.CanceledException e) {
e.printStackTrace();
}
}
~~~
**方法二**:打開GPS位置信息設置頁面,讓用戶自行打開
~~~
//打開位置信息設置頁面讓用戶自己設置
private void openGPS2(){
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivityForResult(intent,0);
}
~~~
## 4.動態獲取位置信息
這個非常簡單,調用requestLocationUpdates方法設置一個LocationListener定時檢測位置而已!
示例代碼如下:
布局:**activity_location.xml**:
~~~
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/tv_show"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="5dp"
android:textSize="20sp"
android:textStyle="bold" />
</LinearLayout>
~~~
LocationActivity.java:
~~~
/**
* Created by Jay on 2015/11/20 0020.
*/
public class LocationActivity extends AppCompatActivity {
private LocationManager lm;
private TextView tv_show;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_location);
tv_show = (TextView) findViewById(R.id.tv_show);
lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
if (!isGpsAble(lm)) {
Toast.makeText(LocationActivity.this, "請打開GPS~", Toast.LENGTH_SHORT).show();
openGPS2();
}
//從GPS獲取最近的定位信息
Location lc = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);
updateShow(lc);
//設置間隔兩秒獲得一次GPS定位信息
lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 2000, 8, new LocationListener() {
@Override
public void onLocationChanged(Location location) {
// 當GPS定位信息發生改變時,更新定位
updateShow(location);
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
}
@Override
public void onProviderEnabled(String provider) {
// 當GPS LocationProvider可用時,更新定位
updateShow(lm.getLastKnownLocation(provider));
}
@Override
public void onProviderDisabled(String provider) {
updateShow(null);
}
});
}
//定義一個更新顯示的方法
private void updateShow(Location location) {
if (location != null) {
StringBuilder sb = new StringBuilder();
sb.append("當前的位置信息:\n");
sb.append("精度:" + location.getLongitude() + "\n");
sb.append("緯度:" + location.getLatitude() + "\n");
sb.append("高度:" + location.getAltitude() + "\n");
sb.append("速度:" + location.getSpeed() + "\n");
sb.append("方向:" + location.getBearing() + "\n");
sb.append("定位精度:" + location.getAccuracy() + "\n");
tv_show.setText(sb.toString());
} else tv_show.setText("");
}
private boolean isGpsAble(LocationManager lm) {
return lm.isProviderEnabled(android.location.LocationManager.GPS_PROVIDER) ? true : false;
}
//打開設置頁面讓用戶自己設置
private void openGPS2() {
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivityForResult(intent, 0);
}
}
~~~
好的,非常簡單,因為gps需要在室外才能用,于是趁著這個機會小跑出去便利店買了杯奶茶, 順道截下圖~
??
**requestLocationUpdates**?(String provider, long minTime, float minDistance, LocationListener listener)
當時間超過minTime(單位:毫秒),或者位置移動超過minDistance(單位:米),就會調用listener中的方法更新GPS信息,建議這個minTime不小于60000,即1分鐘,這樣會更加高效而且省電,加入你需要盡可能 實時地更新GPS,可以將minTime和minDistance設置為0
對了,別忘了,你還需要一枚權限:
~~~
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
~~~
* * *
## 5.臨近警告(地理圍欄)
嗯,就是固定一個點,當手機與該點的距離少于指定范圍時,可以觸發對應的處理! 有點像地理圍欄...我們可以調用LocationManager的addProximityAlert方法添加臨近警告! 完整方法如下:
**addProximityAlert**(double latitude,double longitude,float radius,long expiration,PendingIntent intent)
屬性說明:
* **latitude**:指定固定點的經度
* **longitude**:指定固定點的緯度
* **radius**:指定半徑長度
* **expiration**:指定經過多少毫秒后該臨近警告就會過期失效,-1表示永不過期
* **intent**:該參數指定臨近該固定點時觸發該intent對應的組件
**示例代碼如下**:
**ProximityActivity.java**:
~~~
/**
* Created by Jay on 2015/11/21 0021.
*/
public class ProximityActivity extends AppCompatActivity {
private LocationManager lm;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_proximity);
lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
//定義固定點的經緯度
double longitude = 113.56843;
double latitude = 22.374937;
float radius = 10; //定義半徑,米
Intent intent = new Intent(this, ProximityReceiver.class);
PendingIntent pi = PendingIntent.getBroadcast(this, -1, intent, 0);
lm.addProximityAlert(latitude, longitude, radius, -1, pi);
}
}
~~~
還需要注冊一個廣播接收者:**ProximityReceiver.java**:
~~~
/**
* Created by Jay on 2015/11/21 0021.
*/
public class ProximityReceiver extends BroadcastReceiver{
@Override
public void onReceive(Context context, Intent intent) {
boolean isEnter = intent.getBooleanExtra( LocationManager.KEY_PROXIMITY_ENTERING, false);
if(isEnter) Toast.makeText(context, "你已到達南軟B1棟附近", Toast.LENGTH_LONG).show();
else Toast.makeText(context, "你已離開南軟B1棟附近", Toast.LENGTH_LONG).show();
}
}
~~~
別忘了注冊:
~~~
<receiver android:name=".ProximityReceiver"/>
~~~
**運行效果圖**:
PS:好吧,設置了10m,結果我從B1走到D1那邊,不止10m了吧...還剛好下雨
?
* * *
## 6.本節示例代碼下載
[GPSDemo.zip](http://static.runoob.com/download/GPSDemo.zip)
* * *
## 本節小結:
> 好的,本節給大家介紹了Android中GPS定位的一些基本用法,非常簡單,內容部分參考的 李剛老師的《Android瘋狂講義》,只是對例子進行了一些修改以及進行了可用性的測試! 本節就到這里,謝謝~
- 第一章——環境搭建和開發相關
- 1.0 Android基礎入門教程
- 1.1 背景相關與系統架構分析
- 1.2 開發環境搭建
- 1.2.1 使用Eclipse + ADT + SDK開發Android APP
- 1.2.2 使用Android Studio開發Android APP
- 1.3 SDK更新不了問題解決
- 1.4 Genymotion模擬器安裝
- 1.5 GIT教程
- 1.5.1 Git使用教程之本地倉庫的基本操作
- 1.5.2 Git之使用GitHub搭建遠程倉庫
- 1.6 .9(九妹)圖片怎么玩
- 1.7 界面原型設計
- 1.8 工程相關解析(各種文件,資源訪問)
- 1.9 Android程序簽名打包
- 1.11 反編譯APK獲取代碼&資源
- 第二章——Android中的UI組件的詳解
- 2.1 View與ViewGroup的概念
- 2.2 布局
- 2.2.1 LinearLayout(線性布局)
- 2.2.2 RelativeLayout(相對布局)
- 2.2.3 TableLayout(表格布局)
- 2.2.4 FrameLayout(幀布局)
- 2.2.5 GridLayout(網格布局)
- 2.2.6 AbsoluteLayout(絕對布局)
- 2.3 表單
- 2.3.1 TextView(文本框)詳解
- 2.3.2 EditText(輸入框)詳解
- 2.3.3 Button(按鈕)與ImageButton(圖像按鈕)
- 2.3.4 ImageView(圖像視圖)
- 2.3.5.RadioButton(單選按鈕)&Checkbox(復選框)
- 2.3.6 開關按鈕ToggleButton和開關Switch
- 2.3.7 ProgressBar(進度條)
- 2.3.8 SeekBar(拖動條)
- 2.3.9 RatingBar(星級評分條)
- 2.4 控件
- 2.4.1 ScrollView(滾動條)
- 2.4.2 Date & Time組件(上)
- 2.4.3 Date & Time組件(下)
- 2.4.4 Adapter基礎講解
- 2.4.5 ListView簡單實用
- 2.4.6 BaseAdapter優化
- 2.4.7ListView的焦點問題
- 2.4.8 ListView之checkbox錯位問題解決
- 2.4.9 ListView的數據更新問題
- 2.5 Adapter類控件
- 2.5.0 構建一個可復用的自定義BaseAdapter
- 2.5.1 ListView Item多布局的實現
- 2.5.2 GridView(網格視圖)的基本使用
- 2.5.3 Spinner(列表選項框)的基本使用
- 2.5.4 AutoCompleteTextView(自動完成文本框)的基本使用
- 2.5.5 ExpandableListView(可折疊列表)的基本使用
- 2.5.6 ViewFlipper(翻轉視圖)的基本使用
- 2.5.7 Toast(吐司)的基本使用
- 2.5.8 Notification(狀態欄通知)詳解
- 2.5.9 AlertDialog(對話框)詳解
- 2.6 對話框控件
- 2.6.0 其他幾種常用對話框基本使用
- 2.6.1 PopupWindow(懸浮框)的基本使用
- 2.6.2 菜單(Menu)
- 2.6.3 ViewPager的簡單使用
- 2.6.4 DrawerLayout(官方側滑菜單)的簡單使用
- 第三章——Android的事件處理機制
- 3.1.1 基于監聽的事件處理機制
- 3.2 基于回調的事件處理機制
- 3.3 Handler消息傳遞機制淺析
- 3.4 TouchListener PK OnTouchEvent + 多點觸碰
- 3.5 監聽EditText的內容變化
- 3.6 響應系統設置的事件(Configuration類)
- 3.7 AnsyncTask異步任務
- 3.8 Gestures(手勢)
- 第四章——Android的四大組件
- 4.1.1 Activity初學乍練
- 4.1.2 Activity初窺門徑
- 4.1.3 Activity登堂入室
- 4.2.1 Service初涉
- 4.2.2 Service進階
- 4.2.3 Service精通
- 4.3.1 BroadcastReceiver牛刀小試
- 4.3.2 BroadcastReceiver庖丁解牛
- 4.4.1 ContentProvider初探
- 4.4.2 ContentProvider再探——Document Provider
- 4.5.1 Intent的基本使用
- 4.5.2 Intent之復雜數據的傳遞
- 第五章——Fragment(碎片)
- 5.1 Fragment基本概述
- 5.2.1 Fragment實例精講——底部導航欄的實現(方法1)
- 5.2.2 Fragment實例精講——底部導航欄的實現(方法2)
- 5.2.3 Fragment實例精講——底部導航欄的實現(方法3)
- 5.2.4 Fragment實例精講——底部導航欄+ViewPager滑動切換頁面
- 5.2.5 Fragment實例精講——新聞(購物)類App列表Fragment的簡單實現
- 第六章——Android數據存儲與訪問
- 6.1 數據存儲與訪問之——文件存儲讀寫
- 6.2 數據存儲與訪問之——SharedPreferences保存用戶偏好參數
- 6.3.1 數據存儲與訪問之——初見SQLite數據庫
- 6.3.2 數據存儲與訪問之——又見SQLite數據庫
- 第七章——Android網絡編程
- 7.1.1 Android網絡編程要學的東西與Http協議學習
- 7.1.2 Android Http請求頭與響應頭的學習
- 7.1.3 Android HTTP請求方式:HttpURLConnection
- 7.1.4 Android HTTP請求方式:HttpClient
- 7.2.1 Android XML數據解析
- 7.2.2 Android JSON數據解析
- 7.3.1 Android 文件上傳
- 7.3.2 Android 文件下載(1)
- 7.3.3 Android 文件下載(2)
- 7.4 Android 調用 WebService
- 7.5.1 WebView(網頁視圖)基本用法
- 7.5.2 WebView和JavaScrip交互基礎
- 7.5.3 Android 4.4后WebView的一些注意事項
- 7.5.4 WebView文件下載
- 7.5.5 WebView緩存問題
- 7.5.6 WebView處理網頁返回的錯誤碼信息
- 7.6.1 Socket學習網絡基礎準備
- 7.6.2 基于TCP協議的Socket通信(1)
- 7.6.3 基于TCP協議的Socket通信(2)
- 7.6.4 基于UDP協議的Socket通信
- 第八章——Android繪圖與動畫基礎
- 8.1.1 Android中的13種Drawable小結 Part 1
- 8.1.2 Android中的13種Drawable小結 Part 2
- 8.1.3 Android中的13種Drawable小結 Part 3
- 8.2.1 Bitmap(位圖)全解析 Part 1
- 8.2.2 Bitmap引起的OOM問題
- 8.3.1 三個繪圖工具類詳解
- 8.3.2 繪圖類實戰示例
- 8.3.3 Paint API之—— MaskFilter(面具)
- 8.3.4 Paint API之—— Xfermode與PorterDuff詳解(一)
- 8.3.5 Paint API之—— Xfermode與PorterDuff詳解(二)
- 8.3.6 Paint API之—— Xfermode與PorterDuff詳解(三)
- 8.3.7 Paint API之—— Xfermode與PorterDuff詳解(四)
- 8.3.8 Paint API之—— Xfermode與PorterDuff詳解(五)
- 8.3.9 Paint API之—— ColorFilter(顏色過濾器)(1/3)
- 8.3.10 Paint API之—— ColorFilter(顏色過濾器)(2-3)
- 8.3.11 Paint API之—— ColorFilter(顏色過濾器)(3-3)
- 8.3.12 Paint API之—— PathEffect(路徑效果)
- 8.3.13 Paint API之—— Shader(圖像渲染)
- 8.3.14 Paint幾個枚舉/常量值以及ShadowLayer陰影效果
- 8.3.15 Paint API之——Typeface(字型)
- 8.3.16 Canvas API詳解(Part 1)
- 8.3.17 Canvas API詳解(Part 2)剪切方法合集
- 8.3.18 Canvas API詳解(Part 3)Matrix和drawBitmapMash
- 8.4.1 Android動畫合集之幀動畫
- 8.4.2 Android動畫合集之補間動畫
- 8.4.3 Android動畫合集之屬性動畫-初見
- 8.4.4 Android動畫合集之屬性動畫-又見
- 第九章——Android中的多媒體開發
- 9.1 使用SoundPool播放音效(Duang~)
- 9.2 MediaPlayer播放音頻與視頻
- 9.3 使用Camera拍照
- 9.4 使用MediaRecord錄音
- 第十章——系統服務
- 10.1 TelephonyManager(電話管理器)
- 10.2 SmsManager(短信管理器)
- 10.3 AudioManager(音頻管理器)
- 10.4 Vibrator(振動器)
- 10.5 AlarmManager(鬧鐘服務)
- 10.6 PowerManager(電源服務)
- 10.7 WindowManager(窗口管理服務)
- 10.8 LayoutInflater(布局服務)
- 10.9 WallpaperManager(壁紙管理器)
- 10.10 傳感器專題(1)——相關介紹
- 10.11 傳感器專題(2)——方向傳感器
- 10.12 傳感器專題(3)——加速度/陀螺儀傳感器
- 10.12 傳感器專題(4)——其他傳感器了解
- 10.14 Android GPS初涉
- 第十一章——由來、答疑和資源
- 11.0《2015最新Android基礎入門教程》完結散花~