Table of Contents

  1. Requirements
  2. Installation
  3. Setup
  4. Booking Rides
  5. Further reading

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.

// 1. Define the theme to match your brand (optional):
val theme = MozioTheme()
theme.colors.primary = Color.RED

// 2. Create the configuration object:
val config = MozioConfiguration(
    apiKey = "<Your Mozio API-KEY>", // This is your Mozio API-KEY. You need to request one from us.
    theme = theme, // Optional. Not passing this parameter will use the default theme.
    debug = true // Setting this to True will enable debug logging. It's desirable to set it to False in release builds.
)

// 3. Initialize the SDK:
Mozio.initialize(applicationContext, config)
// 1. Define the theme to match your brand (optional):
final MozioTheme theme = new MozioTheme();
theme.colors.primary = Color.RED;

// 2. Define preferred locales (optional):
final ArrayList<Locale> preferredLocales = new ArrayList<>();
preferredLocales.add(new Locale("es", "MX"));
preferredLocales.add(Locale.ENGLISH);

// 3. Create the configuration object:
MozioConfiguration config = new MozioConfiguration(
    "<Your Mozio API-KEY>", // This is your Mozio API-KEY. You need to request one from us.
    theme, // Optional. Not passing this parameter will use the default theme.
    true // Setting this to True will enable debug logging. It's desirable to set it to False in release builds.
);

// 4. Initialize the SDK:
Mozio.getInstance().initialize(getApplicationContext(), config);


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.