Skip to content

Configuring the SDK and Test Application#

Follow the steps below to configure the SDK and build the Metadata Test App. Use a similar approach to build test apps for other modules.

  1. Download the latest InFlight Companion App SDK from the Hangar Developer Program portal.

  2. Unzip the downloaded file and navigate to the test-app-src directory.

    test-app-src directory highlighted

  3. Select the module to build, such as Metadata (metadata), and copy its src folder.

    src directory highlighted

  4. Set up a new Android Studio Project and set the build configuration language to Groovy.

    To do so, open Android Studio and select File, then New Project.

    Android Studio, create new project

    Select Empty Activity.

    Empty Activity highlighted

    Enter the project name and save location, then choose Groovy DSL for the build configuration language.

    Empty Activity configuration

    Create the project.

  5. Include SDK libraries in the project.

    In the project's app directory, create a new folder called libs, then copy and paste the required .aar files from the SDK bundle into the lib folder.

    Files within libs within the app directory

    Note

    • Each SDK service requires both inflight-android-sdk-service-core.aar and its module-specific AAR to function correctly.

    • All AARs must be of the same version; mixing versions is not supported.

  6. Include the module source in the App Module.

    For example, for the Metadata module, copy the src folder from the metadata directory and paste it into the app directory of the newly created project.

    metadata src copied into app directory

  7. Extract module dependencies from build.gradle.

    To do so, open the build.gradle file from test-app-src and note the required dependencies for the module.

    build.gradle within Metadata module

    The following is an example for the Metadata module.

    • inflight-android-sdk-service-metadata-<version>.aar

    • inflight-android-sdk-service-core-<version>.aar

    • inflight-android-sdk-service-analytics-<version>.aar

    • inflight-android-sdk-service-advertising-'<version>.aar

    Metadata dependencies

  8. Add the .aar files as dependencies in the build.gradle file in the app directory.

    AAR dependencies in the build.gradle file

  9. Ensure the following compile options are available in the build.gradle file.

    • sourceCompatibility JavaVersion.VERSION_1_8
    • targetCompatibility JavaVersion.VERSION_1_8

    build.gradle compileOptions

  10. Configure the namespace and application ID in the build.gradle file.

    To do so, open the AndroidManifest.xml file from the copied src folder and note the package name. For example, aero.panasonic.test.metadata.

    androidmanifest.xml package name highlighted

    Then set namespace and applicationId in the build.gradle file to the package name found above.

    build.gradle namespace and applicationId set to the package name

  11. Build, run, and test your module test application.

    To do so, select your preferred Android Virtual Device (AVD), then build and run the module test application.

    For example, in the Metadata test application, add the application ID, then select GROUND to get the ground metadata.

MetadataTestApp

  1. After navigating to Ground, you can now view the metadata.

    Screen within MetadataTestApp

Note

The entry point for each service is the initService method, which initializes the service instance and provides a callback interface through IInFlightCallback.