Skip to content

Getting Started

Required

Needed by every integration.

Introduction

This guide is a quick start to adding the Oriient Indoor Positioning System (IPS) to an Android app. Android Studio is the recommended development environment for building an app with the IPS SDK for Android.

Implementation

Step 1. Add IPS SDK Gradle dependency

Open the build.gradle file inside your application module directory and add a new dependency for the latest version of IPS SDK:

dependencies {
    implementation "me.oriient:ips:9.11.0"
}
dependencies {
    implementation("me.oriient:ips:9.11.0")
}

Note

Android Studio projects contain a top-level build.gradle file and a build.gradle file for each module. Be sure to edit the file for your application module. See Building Your Project with Gradle for more information about Gradle.

Step 2. Add build options

Inside build.gradle, add the following if not already present:

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }
    kotlinOptions {
        jvmTarget = "11"
    }
    packagingOptions { resources.excludes.add("META-INF/*.kotlin_module") }
}
android {
    compileOptions {
        setSourceCompatibility(JavaVersion.VERSION_11)
        setTargetCompatibility(JavaVersion.VERSION_11)
    }
    kotlinOptions {
        jvmTarget = "11"
    }
    packagingOptions { resources.excludes.add("META-INF/*.kotlin_module") }
}

Make sure the project is using Java version of 17+.

Step 3. Add Oriient's maven repository

Open settings.gradle file and add the following repository:

dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven {
            url "https://oriient.jfrog.io/artifactory/libs-release-local"
            credentials {
                username = "[SDK Access Username]"
                password = "[SDK Access Password]"
            }
        }
        maven {
            url "https://jitpack.io"
        }
    }
}
dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven {
            url = uri("https://oriient.jfrog.io/artifactory/libs-release-local")
            credentials {
                username = "[SDK Access Username]"
                password = "[SDK Access Password]"
            }
        }
        maven {
            url = uri("https://jitpack.io")
        }
    }
}

In the newly added repository, replace the [SDK Access Username] and [SDK Access Password] with your Oriient credentials.

Step 4. Add com.google.android.gms:play-services-location dependency

If your app doesn't already have com.google.android.gms:play-services-location dependency, add it to your module's build.gradle file:

dependencies {
    implementation "com.google.android.gms:play-services-location:21.0.0"
}
dependencies {
    implementation("com.google.android.gms:play-services-location:21.0.0")
}

If your app has this dependency, force gradle to use your version:

configurations.all {
    resolutionStrategy {
        force "com.google.android.gms:play-services-location:your_version_number"
    }
}
configurations.all {
    resolutionStrategy {
        force("com.google.android.gms:play-services-location:your_version_number")
    }
}

Step 5. Syncing

Click Sync Project with Gradle Files in the toolbar.

You can now begin developing features with the Indoor Positioning APIs.

Info

  • Starting from version 2.15.0, IPS SDK uses androidx
  • The IPS SDK supports Android API versions of 24 and above

Step 6. Update Proguard Rules (If Applicable)

If your app uses Proguard to minify the project, please add the following rules to your proguard-rules.pro file:

# Oriient IPS SDK
-keep class me.oriient.** { *; }
-dontwarn javax.annotation.Nullable