In the developerβs settings you need to set the Allow location layout. After that, you can write a small utility application in which the layout of the location will be set upon receipt of a specific user event.
Then you can set the location using adb shell command like
$ adb shell am start -a android.intent.action.SET_CUSTOM_MOCK_LOCATION -d gps://lat-long
You can get this information in your utility application and set the local location. Hope this helps
Akhil source share