GPSを使用してプログラムを作成しました。緯度と経度は約8マイルです。GPSを使用している私のAndroidプログラムは非常に間違っています
私はそれが私の中にいると思われるかもしれませんが、私は私の電話でGoogleマップを使用すると、私の家に私を示しています。
これはどういう考えですか?
以下のコード:
public class Clue extends Activity {
public static double latitude;
public static double longitude;
LocationManager lm;
LocationListener ll;
Location location;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.blah);
Criteria criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_FINE);
lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
ll = new MyLocationListener()}
private boolean getLoc() {
location = getLocation();
longitude = location.getLongitude();
latitude = location.getLatitude();
return inCorrectPlace(params);
}
private Location getLocation() {
lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, ll);
return lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);
}
}
私はすべてのヘルプは理解されるであろう、無関係なコードを取り除かれています。
を参照してください?時間をチェックできますか? – chiuki