android development
I want to change android gps location with my app for testing
loc.setLatitude(39.927287);
loc.setLongitude(32.848789);
loc.setAccuracy(Criteria.ACCURACY_FINE);//bu değiştirildi
loc.setTime(System.currentTimeMillis());//bu değiştirildi.
loc.setElapsedRealtimeNanos(100);
loc.setSpeed(0.0f);
loc.setAltitude(1.0);
loc.setBearing(0.0f);
LocManager.addTestProvider(LocationManager.GPS_PROVIDER, "requiresNetwork" == "",
"requiresSatellite" == "",
"requiresCell" == "",
"hasMonetaryCost" == "",
"supportsAltitude" == "",
"supportsSpeed" == "",
"supportsBearing" == "", 1, 3);
LocManager.setTestProviderEnabled(LocationManager.GPS_PROVIDER, true);
LocManager.setTestProviderStatus(LocationManager.GPS_PROVIDER,
LocationProvider.AVAILABLE,
null, System.currentTimeMillis());
LocManager.setTestProviderLocation(LocationManager.GPS_PROVIDER, loc);
my code is here
I opened developer options and i changed mocklocation app to my app
sorry for my bad english
Everything is fine but my app not working
I cant see my location to mock location in google maps
How can set a mock location for testing ?
Please format the code you posted, by wrapping it in triple backticks. -> `
Обсуждают сегодня