2013-02-18 66 views
0

Android中可用的硬件可以使用hasSystemFeature()進行檢查。但是,當我嘗試在模擬器上調用context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LOCATION_GPS)context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LOCATION_NETWORK)時,這兩個命令都返回false。仿真器的hasSystemFeature for GPS和NETWORK總是返回false?

這是儘管模擬器有一個GPS。可能是什麼問題呢?我如何在模擬器中檢查它是否有GPS或NETWORK硬件?

回答

0

嘗試設置自己的經緯度爲仿真器:使用DDMS

->go to your android/tools directory, and launch the DDMS tool 
->select the Emulator Control Tab 
->fill the Location Controls fields with the longitude and latitude values 
->press the Send button 
: 按照此