DeviceAnalyser (Deprecated)
Get relevant information from an Android device.
The Device Analyser is capable of obtaining highly accurate geolocation data.
Runtime permissions
Permission | Reason | Required |
---|---|---|
| To get the approximate location | Yes. |
| To get the exact location | Yes. |
Instantiating the SDK
First, create an object of type DeviceAnalyser
. This object is for you to configure all your business rules for the SDK:
Builder method
Parameter | Required |
---|---|
Your activity, to set the context of the application | Yes |
Sets the priority of accuracy, which can be:
Priorities are available in the Constants class, e.g.: | No, by default it is
|
Returns the geolocation information if available, otherwise returns a sdkFailure. Expects a locationListener as an argument, as explained in this example. | Yes. |
LocationInfo
Method | Data Type |
---|---|
Returns whether the device is using a dummy/fake location | boolean |
Returns the latitude information | double |
Returns the longitude information | double |
Returns the accuracy of the information obtained | float |
LocationListener
Result | Data Type |
---|---|
On success, returns a LocationInfo object with the geolocation data:
| LocationInfo |
On failure, returns a sdkFailure | Failure |
Example of use
onActivityResult
Use the onActivityResult
method to get the result of the user's interaction with the GPS activation request popup on the device:
Last updated