I'm porting an iOS app to Kotlin/Android. Is there...
# android
t
I'm porting an iOS app to Kotlin/Android. Is there a parallel to CLLocationCoordinate2D in Android? I found Location, but that's more analagous to iOS's CLLocation (which is a coordinate plus bearing and other things). I found LatLng which looked like it might be what I wanted until I noticed that was in androidx.car. 😞 Number DDG searches aren't really turning up anything. Maybe there's a class name that's just obvious, I've missed it? Or a third party library?
z
That looks like it’s basically just a
Pair<Double, Double>
, or you could make a data class with better names. I don’t think there’s any standard type.
t
i appears it's in the play-servics-maps too. So that's cool. Now I'm just having problems with conflicting dependencies. sigh.
b
Location
is about the only thing Android has. I wouldn't use
Pair
as it auto-boxes primitives. I would make a simple class that takes in non-optional
Doubles
If you need equals/hash, then make it a
data class