第一頁 返回 繼續 最後一頁 概覽 圖形
Location Service(1)
Android provides Wifi and GPS Location Service
Location Service is a System Service
LocationManager LM;
Location lo;
LM=(LocationManager) (this.getSystemService(Context.LOCATION_SERVICE));
if (LM.isProviderEnabled(LocationManager.GPS_PROVIDER))
lo = LM.getLastKnownLocation(LocationManager.GPS_PROVIDER);
else if ( LM.isProviderEnabled(LocationManager.NETWORK_PROVIDER))
lo = LM.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
else lo=null;