Link Search Menu Expand Document

Integration

To add the CarTrawlerSDK to your app, add our maven repository and enter your artifactory credentials.

Table of Contents
  1. Maven & Artifactory Repository
    1. Android Gradle Plugin (AGP) before 7.0
    2. Android Gradle Plugin (AGP) 7+
  2. Getting Credentials
  3. Adding the Dependency to your App
  4. App Permissions

Maven & Artifactory Repository

Android Gradle Plugin (AGP) before 7.0

You should add the following repository into you root build.gradle file:

repositories {
    maven {
        url "https://cartrawler.jfrog.io/artifactory/libs-release-local"
        credentials { 
            username = "your_username_here" 
            password = "your_password_here" 
        }
    }
}

Android Gradle Plugin (AGP) 7+

You should add the following repository into you settings.gradle file:

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        maven {
            url "https://cartrawler.jfrog.io/artifactory/libs-release-local"
            credentials {
                username = "your_username_here"
                password = "your_password_here"
            }
        }
    }
}

Getting Credentials

If you do not have these credentials contact your manager, IT, or another developer in your team.


Adding the Dependency to your App

Add the CarTrawler dependency to build.gradle. Please use the version number sent to you by CarTrawler.

implementation "com.cartrawler.android:car-rental:$latestVersion" 

We use semantic versioning to define the SDK version number, so the version number will always follow the pattern major.minor.patch, eg: 1.0.0

Create a theme that extends the CTDayNightTheme. Please refer to the theme section for further details.


App Permissions

The CarTrawler web booking flow and Grid View can offer users a search based on their current location. When the web page requests the device location, the SDK asks for the ACCESS_FINE_LOCATION runtime permission if it has not already been granted.

To make use of this feature, please ensure your Manifest declares the ACCESS_FINE_LOCATION permission (and optionally ACCESS_COARSE_LOCATION). If the permission is not available, users can still search by typing a location.