Android
Table of Contents
1. Requirements
- Minimum API Level: 21
- Java 1.8 support in the module-level gradle file:
android { compileOptions { sourceCompatibility 1.8 targetCompatibility 1.8 } // Other options... }
2. Installation
2.1 Add our repo to the project-level gradle file
allprojects {
repositories {
// Other repos...
maven { url "https://mozio.jfrog.io/mozio/android-sdk" }
}
}
2.2 Add the latest SDK dependency to the module-level gradle file
Production (use this for real bookings)
dependencies {
// ...other dependencies
// If you use the Android Support library:
implementation 'com.mozio.moziosdk:sdk-production:2.1.1'
// OR, if you use AndroidX:
implementation 'com.mozio.moziosdk:sdk-androidx-production:2.1.1'
}
Staging (use this to test the implementation)
dependencies {
//...other dependencies
// If you use the Android Support library:
implementation 'com.mozio.moziosdk:sdk-staging:2.1.1'
// OR, if you use AndroidX:
implementation 'com.mozio.moziosdk:sdk-androidx-staging:2.1.1'
}
3. Setup
3.1 Adding your Google Maps API-KEY
The SDK uses Google Maps as the mapping solution. You will need to add your Google Maps API-KEY to the project in order for Mozio features to work.
If your app already uses Google Maps, chances are this is already set up! Otherwise, add the following to your app’s AndroidManifest.xml
, inside the <application>
section:
<application
android:other="stuff">
<!-- Other stuff -->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="<Your Google Maps API-KEY>" />
</application>
Find more information about how to get that API-KEY in the Google Maps SDK For Android official guide.
You are all set!
3.2 Initialization
Before using any Mozio features, you will need to initialize the SDK. The best place to do this is in your custom Application
class.
If you still don’t have a Mozio API-KEY
, reach us at sdk@mozio.com.
4. Booking rides
Now that you’re fully installed, you can start adding booking features to your app.
Full details in our Booking guide.
5. Further reading
There are other topics you will need to cover, like adding Tracking status to your UI and using the Staging environment to test the booking flow.
Full details in our Advanced guide.