What false locations are needed:
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION">
Also, in the settings of your Android phone, make sure that the "Allow layouts" checkbox is checked
locationManager.addTestProvider(mocLocationProvider, false, false, false, false, true, true, true, 0, 5); locationManager.setTestProviderEnabled(mocLocationProvider, true);
. Now that you want to send the location, call this code:
Location mockLocation = new Location(mocLocationProvider);
.
But this only works for the first time
Because you called him once.
I need to make a service for what I want to do
You can do it, even AsyncTask will do
do it or not: lm.requestLocationUpdates ()
Yes you should with mocLocationProvider
I already call the setLocation method (latitude, longitude) many times, but it only works (update location) for the first time for google maps
There is no method called setLocation() , use setTestLocation()
What should I do in asynckTask
You can use Thread, TimerTask, or whatever you like. The idea is to enter the location in the Frame each time.