Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skedgo/tripkit-android
SkedGo's TripKit for Android
https://github.com/skedgo/tripkit-android
routing sdk-android trip-planning tripgo-api
Last synced: about 2 months ago
JSON representation
SkedGo's TripKit for Android
- Host: GitHub
- URL: https://github.com/skedgo/tripkit-android
- Owner: skedgo
- License: apache-2.0
- Created: 2015-07-02T06:26:37.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-07-31T07:24:36.000Z (5 months ago)
- Last Synced: 2024-07-31T07:36:02.887Z (5 months ago)
- Topics: routing, sdk-android, trip-planning, tripgo-api
- Language: Java
- Homepage: https://android.developer.tripgo.com/
- Size: 43.5 MB
- Stars: 4
- Watchers: 17
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# TripKit for Android
[![Build Status](https://travis-ci.org/skedgo/tripkit-android.svg?branch=master)](https://travis-ci.org/skedgo/tripkit-android)## Set up TripKit
### Add TripKit to your Android project
First, add [JitPack maven](https://jitpack.io/):
```groovy
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
```Then, in app's build file, add `TripKitAndroid` dependency into dependencies section:
```groovy
dependencies {
implementation 'com.github.skedgo:tripkit-android:'
}
```
[![Release](https://jitpack.io/v/skedgo/tripkit-android.svg)](https://jitpack.io/#skedgo/tripkit-android)For a full setup, you can have a look at TripKitSamples' build file [here](https://github.com/skedgo/tripkit-android/blob/dev/TripKitSamples/build.gradle).
#### Required configuration
##### Supported Android versions
TripKit supports for Android apps running [Android 4.0.3](https://developer.android.com/about/versions/android-4.0.3.html) and above. To make sure that it works in your Android app, please specify `minSdkVersion` in your `build.gradle` file to `15`:
```groovy
android {
defaultConfig {
minSdkVersion 16
}
}
```Add `android.enableJetifier=true` on your `gradle.properties` file
```groovy
android.useAndroidX=true
....
android.enableJetifier=true
```##### Get an API key
An API key is necessary to use TripKit's services, such as A-2-B routing, and all-day routing. In order to obtain an API key, you can sign up at [https://tripgo.3scale.net](https://tripgo.3scale.net/).
#### Create TripKit instance to access TripKit's services
We recommend to have an `Application` subclass. Next, in the `onCreate()` method, you can initiate following setup:
for `>= v2.1.43`
```kotlin
class App : Application() {
override fun onCreate() {
super.onCreate()
TripKitConfigs.builder().context(this)
.debuggable(true)
.key { key }
.build()val httpClientModule = HttpClientModule(null, null, configs)
val tripKit = DaggerTripKit.builder()
.mainModule(MainModule(configs))
.httpClientModule(httpClientModule)
.build()TripKit.initialize(this, tripKit)
}
}```
With `"YOUR_API_KEY"` is the key that you obtained from [https://tripgo.3scale.net](https://tripgo.3scale.net) in the previous step.