https://kotlinlang.org logo
#android
Title
# android
t

Travis Griggs

01/31/2020, 9:44 PM
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

Zach Klippenstein (he/him) [MOD]

01/31/2020, 9:59 PM
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

Travis Griggs

01/31/2020, 10:13 PM
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

baxter

01/31/2020, 10:35 PM
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