Device Location
Obtain the device location using a combination of WIFI, GPS, and cell phone towers signals.
BiometridStandard.getInstance().getLocation(processCallback);
ProcessCallback callback
The process result callback.
Implementation example
class ExampleActivity extends AppCompatActivity implements InitializationCallback {
String TAG = getClass().getSimpleName();
String BIOMETRID_API_SERVER_URL = "your server URL";
String BIOMETRID_APP = "your app";
String BIOMETRID_CREDENTIAL = "your credential";
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
BiometridStandard.getInstance().initialize(
BIOMETRID_API_SERVER_URL ,
BIOMETRID_APP,
BIOMETRID_CREDENTIAL,
Language.English,
this);
}
@Override
public void initializationCallback(boolean status, @Nullable Errors errors) {
if(status) getLocation();
}
public void getLocation() {
BiometridStandard.getInstance().getLocation(new ProcessCallback() {
@Override
public void locationCallback(@Nullable LocationData location, @Nullable Errors errors) {
if (errors != null) {
Log.e(TAG, "locationCallback -> error: " + errors.getMessage());
} else {
Log.d(TAG, "locationCallback -> location: " + location.toString());
}
});
}
}
locationCallback
Description
LocationData? location
The device location coordinates.
Errors? errors
Detected errors.
LocationData
Description
String? altitude
The altitude coordinates.
String? longitude
The longitude coordinates.
String? latitude
The latitude coordinates.
Was this helpful?