Android Question Location

RUNO

Active Member
Licensed User
Longtime User
My app for delivery.
Can I create an area dependent on longitude and latitude and save it in a database and check the customer's location inside or outside region.
 

drgottjr

Expert
Licensed User
Longtime User
yes. hard to say what you might already know or not know how to do... gps, fused location, sqlite, geofence. search them here. geofence is the key element in this case.
 
Upvote 0

RUNO

Active Member
Licensed User
Longtime User
yes. hard to say what you might already know or not know how to do... gps, fused location, sqlite, geofence. search them here. geofence is the key element in this case.

What result I get?
I changed the center point and radius, I want to check the location inside the circle or not, how?
I want a result.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
You can use:
B4X:
Distance = CenterLocation.DistanceTo(LocationToCheck)

If Distance <= Radius Then
    ' insides
Else
    ' outsides
End If
You know the location of your center and you know the locations to check, so can calculate the distance between those with DistanceTo method of the Location object in the GPS library.
 
Upvote 0
Top