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.
-
Download the latest InFlight Companion App SDK from the Hangar Developer Program portal.
-
Unzip the downloaded file and navigate to the
test-app-srcdirectory. -
Select the module to build, such as Metadata (
metadata), and copy itssrcfolder. -
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.
Select Empty Activity.
Enter the project name and save location, then choose Groovy DSL for the build configuration language.
Create the project.
-
Include SDK libraries in the project.
In the project's
appdirectory, create a new folder calledlibs, then copy and paste the required.aarfiles from the SDK bundle into thelibfolder.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.
-
-
Include the module source in the App Module.
For example, for the Metadata module, copy the
srcfolder from themetadatadirectory and paste it into theappdirectory of the newly created project. -
Extract module dependencies from
build.gradle.To do so, open the
build.gradlefile fromtest-app-srcand note the required dependencies for the 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
-
-
Add the
.aarfiles as dependencies in thebuild.gradlefile in theappdirectory. -
Ensure the following compile options are available in the
build.gradlefile.sourceCompatibility JavaVersion.VERSION_1_8targetCompatibility JavaVersion.VERSION_1_8
-
Configure the namespace and application ID in the
build.gradlefile.To do so, open the
AndroidManifest.xmlfile from the copiedsrcfolder and note the package name. For example,aero.panasonic.test.metadata.Then set
namespaceandapplicationIdin thebuild.gradlefile to the package name found above. -
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.
Note
The entry point for each service is the initService method, which initializes the service instance and provides a callback interface through IInFlightCallback.














