AI-NVR Mobile Application Build

Download & Extract the app source code

  1. Log in to NGC and navigate to moj org, release team

  2. Go to the NGC page of AI NVR Android app.

  3. On that page, use one of the options available in the Download menu (top right).

  4. Extract the files using the following commands.

    unzip files.zip

    tar zxf ai-nvr-android-app.tar.gz

Config changes

The cloud endpoints that the mobile app communicates to can be changed in the app.

Open the file app/build.gradle and change the below build variables in defaultConfig to point the app to your cloud endpoints.

Identity Provider: authEndpoint

OAuth2 Authorization endpoint will be <authEndpoint>/login

OAuth2 Token endpoint will be <authEndpoint>/oauth2/token

Cloud gateway: cloudGatewayEndpoint

Cloud proxy: cloudProxyEndpoint

Additionally, the client ID authClientId, and the client’s redirect URI appAuthRedirectSchemeValue need to be updated.

How to build

Two options.

1. Import the project to Android Studio

Open the project in Android Studio. Build and install the app on the connected device.

2. Using gradle build

  • Set the below paths.

    export JAVA_HOME=<JDK/OpenJDK_path>
    export ANDROID_HOME=<Android_SDK_path>
    export PATH=$JAVA_HOME/bin:<gradle_path>/gradle-6.5/bin:$PATH

  • Build the app using the below command. For more details, see this.

    gradlew --no-daemon clean assembleRelease

Build configuration

  • Target Android SDK 33

  • Android build tools 30.0.3

  • Gradle 6.5

  • Gradle plugin 4.1.3

  • Java OpenJDK 11

  • Kotlin 1.4.10

  • Navigation lib 2.3.0

Third-party libraries

  • Communication, parsing, and building REST requests:

    • com.squareup.retrofit2:retrofit:2.9.0

    • com.squareup.moshi:moshi-adapters:1.8.0

    • com.squareup.moshi:moshi-kotlin:1.10.0

    • com.squareup.retrofit2:converter-moshi:2.9.0

    • com.squareup.okhttp3:logging-interceptor 4.9.1

    • com.squareup.okhttp3:okhttp: 4.9.1

  • Presenting and updating activity graphs:

    • com.github.PhilJay:MPAndroidChart:v3.1.0

  • Dependency injection:

    • com.google.dagger:hilt-android:2.28-alpha

  • Play streams using WebRTC:

    • org.webrtc:google-webrtc:1.0.32006

  • Login and manage OpenID tokens:

    • net.openid:appauth:0.11.1

  • Lazy loading and cache cameras thumbnails:

    • com.github.bumptech.glide:glide:4.12.0