Hi all,
I just wanted to give the community a heads up that we're working on a Kotlin Multiplatform Mobile (KMM) client for OTP2:
This project is designed to make it simple to call the REST API and get a parsed response back, such as:
private lateinit var planApi: PlanApi
...
val requestParameters = RequestParameters(
fromPlace = latLong(41.84712, -87.64678),
toPlace = latLong(41.84584, -87.65214),
arriveBy = "false")
planApi.getPlan(
success = { launch (Main) {
Log.d(TAG, "logData: $it")
} },
failure = ::handleError
)
Target platforms for use as a library are:
1. Android
2. iOS
3. JVM (desktop/server Java/Kotlin)
Supported OTP APIs (so far) are:
1. Plan API
2. Bike Rental API
3. Server Info API
We plan to use this in the OneBusAway Android and iOS apps, as well as another desktop project we're working on.
KMM is new for us so while the code is implemented, we're still working on publishing the artifacts for use (as well as fleshing out unit tests). But if anyone else has KMM experience and wants to take a look, we'd welcome the feedback!
Thanks to Sudarshan Sampathkumar for most of the heavy lifting on this.
Sean
Sean Barbeau
Center for Urban Transportation Research
University of South Florida