- Detects unsafe locations in the user's route either via Push Notifications or shown in map.
- Select and mark an area it as unsafe.
- S.O.S. button on clicking which the user’s location would be shared with users.
- Native Android Kotlin
- UI/UX - Figma OR Adobe XD
- Google Places SDK
- Navigation
- View Mode
- Live Data
- Data Store Preferences
- Data Binding
- Coroutines
- Retrofit
- The core of the app is the Google-Places SDK. A user can create a geofence, with a selected radius(in the range of 1km-10km) to mark it as unsafe. Once marked unsafe, a red region forms around the geofence.
- The corresponding Latitude and Longitude and radius gets stored in an object of class GeofenceDetails, as well as gets uploaded to the Firebase Realtime-Database.
val geofence = Geofence.Builder()
.setRequestId(position.toString())
.setCircularRegion(
location.latitude,
location.longitude,
radius
)
.setExpirationDuration(Geofence.NEVER_EXPIRE)
.setTransitionTypes(
Geofence.GEOFENCE_TRANSITION_ENTER or Geofence.GEOFENCE_TRANSITION_EXIT or Geofence.GEOFENCE_TRANSITION_DWELL
)
fun addGeofence(location: LatLng, radius: Double) {
//Upload on Firebase
DataDetails.geofencesList.clear()
val model= GeofenceDetails2(location.latitude,location.longitude,radius.toDouble())
val uniqueID = mDatabaseRef.push().key
if (uniqueID != null) {
mDatabaseRef.child(uniqueID).setValue(model).addOnSuccessListener {
Log.d("SharedViewModel", "Geofence successfully added")
}
}
}