2014-04-01 32 views
0

我想獲取我的設備位置。按需locationListener + manager與GoogleServices +位置客戶端

有時當前位置而有時定期地每5分鐘

(即使當應用程序是不可見)。

我已經使用了LocationListener + LocationManager。

LocationListener locListener = new MyLocationListener(); 
    locManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, 
      locListener); 

    LocationListener locListener = new MyLocationListener(); 
    locManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, 
      locListener); 

,但我在Android開發人員網站上看到使用LocationClient

我爲什麼應該選擇其中一個比其他?

僅適用於GPS提供商的LocationClient?

回答