Using GeoLocator-Android you could easily get you GPS based location from Android Devices
At the moment we do not have a publishing mechanism to a maven repository so the easiest way to add the library to your app is via a JitPack Dependency
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.AravindVijay7:GeoLocator-Android:1.0.2'
}
GeoLocator geoLocator = new GeoLocator(getApplicationContext(),MainActivity.this);
geoLocator.getLattitude()
geoLocator.getLongitude()