August 2025
Intermediate to advanced
270 pages
6h 16m
English
As expected, we’ll model our approach on what we did for iOS. Start by creating a new Kotlin Data class under the models package named Hike.kt. Add an attribute for name, latitude, and longitude.
| | package com.masilotti.hikingjournal.models |
| | |
| | data class Hike( |
| | val name: String, |
| | val latitude: Double, |
| | val longitude: Double |
| | ) |
Then, expose the coordinate via a computed property. We’ll use this to initialize the LatLng when positioning the map.
| | package com.masilotti.hikingjournal.models |
| | |
| » | import com.google.android.gms.maps.model.LatLng ... |
Read now
Unlock full access