rideOS Android SDK Common Library

null

License

License

Categories

Categories

IDE Development Tools
GroupId

GroupId

ai.rideos.sdk
ArtifactId

ArtifactId

sdk-android-common
Last Version

Last Version

1.0.2
Release Date

Release Date

Type

Type

aar
Description

Description

rideOS Android SDK Common Library
null
Project URL

Project URL

https://github.com/rideOS/rideos-sdk-android
Source Code Management

Source Code Management

https://github.com/rideOS/rideos-sdk-android

Download sdk-android-common

How to add to project

<!-- https://jarcasting.com/artifacts/ai.rideos.sdk/sdk-android-common/ -->
<dependency>
    <groupId>ai.rideos.sdk</groupId>
    <artifactId>sdk-android-common</artifactId>
    <version>1.0.2</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/ai.rideos.sdk/sdk-android-common/
implementation 'ai.rideos.sdk:sdk-android-common:1.0.2'
// https://jarcasting.com/artifacts/ai.rideos.sdk/sdk-android-common/
implementation ("ai.rideos.sdk:sdk-android-common:1.0.2")
'ai.rideos.sdk:sdk-android-common:aar:1.0.2'
<dependency org="ai.rideos.sdk" name="sdk-android-common" rev="1.0.2">
  <artifact name="sdk-android-common" type="aar" />
</dependency>
@Grapes(
@Grab(group='ai.rideos.sdk', module='sdk-android-common', version='1.0.2')
)
libraryDependencies += "ai.rideos.sdk" % "sdk-android-common" % "1.0.2"
[ai.rideos.sdk/sdk-android-common "1.0.2"]

Dependencies

compile (30)

Group / Artifact Type Version
ai.rideos.api : api-android jar 1.0.8
androidx.appcompat » appcompat jar 1.0.2
com.google.android.material » material jar 1.0.0
androidx.media » media jar 1.0.1
androidx.legacy » legacy-support-v4 jar 1.0.0
androidx.constraintlayout » constraintlayout jar 1.1.3
androidx.exifinterface » exifinterface jar 1.0.0
com.google.android.play » core jar 1.6.1
org.mockito : mockito-core jar 1.10.19
com.google.android.gms » play-services-maps jar 17.0.0
com.google.android.gms » play-services-location jar 17.0.0
com.google.maps.android : android-maps-utils jar 0.4.4
com.github.tomrom95 » mapbox-navigation-android jar 006a567f72
io.reactivex.rxjava2 : rxandroid jar 2.1.0
io.reactivex.rxjava2 : rxjava jar 2.2.5
javax.annotation : javax.annotation-api jar 1.2
io.grpc : grpc-protobuf-lite jar 1.22.1
io.grpc : grpc-okhttp jar 1.22.1
io.grpc : grpc-stub jar 1.22.1
io.grpc : grpc-testing jar 1.22.1
com.auth0.android : auth0 jar 1.15.1
com.auth0.android : jwtdecode jar 1.2.0
com.auth0.android : lock jar 2.12.1
com.jakewharton.timber : timber jar 4.7.1
com.f2prateek.rx.preferences2 : rx-preferences jar 2.0.0
com.squareup.picasso : picasso jar 2.71828
de.hdodenhof : circleimageview jar 3.0.0
com.google.firebase » firebase-auth jar 18.1.0
com.google.firebase » firebase-messaging jar 19.0.1
com.google.firebase » firebase-core jar 17.0.1

Project Modules

There are no modules declared in this project.

rideOS Android SDK

Overview

The rideOS Android SDK provides foundations for running rider and driver applications for ride-hail using the rideOS APIs. These applications are intended to work out of the box, but with flexibility to customize easily.

Layout

The SDK is broken up into several libraries. There are 3 core libraries that are used:

  • common - the common library contains utilities and shared resources between the rider and driver apps
  • rider - the rider library has all of the view, controller, and navigation classes to run a rider app. Note that this doesn't actually create or run an app.
  • driver - the driver library has all the view, controller, and navigation classes to run a driver app. It also doesn't actually run anything.
  • google - the google library includes implementations for classes using the Google API and Google Maps products

Running the Apps

Provided in this library are the example_rider_app and example_driver_app. These should serve as a jumping off point for creating an application.

Creating a fleet

Before you start hailing rides, you'll need to create a default fleet for your riders and drivers to operate on. The easiest way to do this is to grab your rideOS API key from https://app.rideos.ai/profile. Once you have the API key, fill it into the following request, along with your intended fleet's ID.

curl -H "Content-Type: application/json" \
    -H "X-Api-Key: YOUR_API_KEY" \
    --data '{"id": "YOUR_FLEET_ID"}' \
    https://api.rideos.ai/ride-hail-operations/v1/CreateFleet

Then, fill in your default fleet id in example_driver_app/src/main/AndroidManifest.xml and example_driver_app/src/main/AndroidManifest.xml

Creating an Auth0 client

To run either of these applications, you will need an Auth0 client ID and database connection. We use Auth0 to authenticate users into our ride-hail endpoints, and we don't currently support 3rd party authentication. Please contact our team to create the ID and user database.

Once you have this information, fill in the relevant string resources in example_rider_app/src/main/res/values/strings.xml and example_driver_app/src/main/res/values/strings.xml

Creating necessary 3rd-party API keys

Additionally, the example rider and driver app will require a Google API key. This key is used to use Google services such as location autocompletion, geocoding, and the map. Please follow these instructions to get a key. Then, add these key to example_rider_app/src/main/AndroidManifest.xml and example_driver_app/src/main/AndroidManifest.xml.

Lastly, the example driver app requires a Mapbox access token for turn-by-turn navigation. Please follow these instructions to get an access token. Then, add this key to example_driver_app/src/main/AndroidManifest.xml.

With these parameters set, you can run the app, log in, and start servicing rides!

Customizing the app

Colors & Icons

The common library exposes common themes for the application. You can change the colors and images of the app by extending these themes and applying it to the relevant activity.

The following themes exist:

  • RideOS.MainTheme- This theme covers all screens after the user has logged in, including requesting rides in the rider app and completing rides in the driver app. It can be applied to the main rider activity or the main driver activity
  • RideOS.LoginTheme- This theme covers the launch flow of the apps, including the splash screen icon. It can be applied to the rider launch activity or the driver launch activity
  • Lock.Theme - This theme is imported from the Auth0 Lock Library and applies to the Auth0 login screen. It is already implemented in the example_rider_app and example_driver_app, and it applies to com.auth0.android.lock.LockActivity

As an example, if you want to customize the color of an active route to purple in the example_rider_app, you would add the following to your styles.xml file.

<style name="YourCustomTheme" parent="RideOS.MainTheme">  
    <item name="rideos.route_color">@android:color/holo_purple</item>  
</style>

Then, in the application's AndroidManifest.xml file, change the declaration of the MainFragmentActivity to:

<activity android:name="ai.rideos.android.rider_app.MainFragmentActivity"  
  android:theme="@style/YourCustomTheme"  
  android:screenOrientation="portrait"  
>  
</activity>

Feature Flags

There are a few feature flags we expose for common customizations to the behavior of the app. These feature flags should be added as metadata values to the appropriate app.

Key Name Application(s) Values Description
enable_developer_options Rider & Driver true/false Enables the developer options menu item in the side menu
rideos_disable_seat_selection Rider true/false Disables the rider from selecting how many seats the trip requires
rideos_fixed_locations Rider true/false Forces the rider app to use discrete, fixed stop locations instead of normal coordinates.
rideos_use_external_routing_for_nav Driver true/false Forces the driver app to use an external routing provider and match to turn-by-turn nav

Architecture

Please see the separate architecture documentation.

Licensing

Code

All code is distributed under the Apache 2.0 license.

Assets

All assets (*.png, *.jpg, etc.) are distributed under the Creative Commons Attribution 4.0 International license.

  • Artist: Yen Ma
  • Copyright: rideOS
ai.rideos.sdk

Versions

Version
1.0.2
1.0.1
1.0.0