Skip to content

Introduction

Thank you for your interest in integrating the CoPilot Navigation Library for Android. The CPIK package includes the following:

Sample App

  • Source code of the sample application
  • Sample application APK that can be install on Android device

Documentation

  • Contains all the documents including API reference document

Library & Resource

  • Libs/CPIKWrapper.dll : Customer application shall use this library to integrate CPIK
  • Native Libs/. : Native library need to place at libs folder in customer application
  • Asset: Need to copy to customer’s application asset folder
  • AndroidManifest_template.xml: Reference AndroidManifest.xml file.

Please note Xamarin interface is available for Android platform. This interface results in all Android compatible APIs being supported within Xamarin Android. It has not been noted on individual APIs that they are also compatible on Xamarin via this interface as it is always true unless stated otherwise.

Sample App

Source Code

  1. Open the SampleApp.sln from Sample App/Source Code/SampleApp.sln to Xamarin Studio

  2. It contains all the information required to run i.e library, asset, resources, component etc.

  3. You can run

com.alk.sampleapp.apk

  1. Sample APK which can be installed on CoPilot

Library & Resource

  • Libs /CPIKWrapper.dll
    This is binding library to interface with CoPilot. All the CPIK jar files are wrap into CPIKWrapper.dll by using the Xamarin Binding Library project. Developer need to add reference to this library into their application.

  • Native libs/.
    This is the native library use by the CoPilot. Copy the native library to your project. Copy all the folders under “Library and Resource/native libs/.” to “<Your project>/lib/.” to your project. It contains native library for different architecture which is required to run CoPilot. If you have existing lib folder to your project, merge the content. To deploy a native library with a Xamarin.Android application, add the library binary to the project and set its Build Action to AndroidNativeLibrary.

  • Asset
    Copy “Library and Resource/assets” folder into your project. Copy entire assets folder located under “Library and Resource/assets/” to “<Your project>/assets/” folder to your project. It contains vital information to run the CoPilot e.g theme, config files, skin etc. If you have existing assets folder to your project, merge the content. Make sure that entire Copilot folder under Assets are added to Xamarin and set BuildAction to AndroidAsset.

  • AndroidManifest_template.xml
    This file contains all required attribute and permission to run the CoPilot. Developer need to merge this information to their existing AndroidManifest.xml.

Library Integration instructions

Setup instructions:

  1. Integrate the contents of "Library & Resource/AndroidManifest_template.xml” into your application's AndroidManifest.xml.

  2. Extract the "Library & Resource/assets” folder from the library package into your project (usually “<Your project>/assets/). Make sure that entire Copilot folder under Assets are added to Xamarin and set BuildAction to AndroidAsset.

  3. Reference "Library & Resource/libs/ CPIKWrapper.dll” to your project to access all the classes/members of the CPIK library and set BuildAction to AndroidNativeLibrary.

  4. Copy "Library & Resource/Native libs/.” folder to your project’s lib folder (usually “<Your project>/lib/.**”). It contains native library for all different architecture.

  5. Develop! Use the included sample application as a guide.

API Documentation

  • The API documentation detailed on this site references the classes and its members. It also contains the signature of the each member of the classes including description and usage.

  • The documentation contains syntax for Java. Developers can easily map the relevant syntax with C# in Xamarin. You can also check the syntax in Xamarin by exploring CPIKWrapper.dll by adding reference in project.

Sample Application

This sample application is meant to demonstrate how to properly integrate CoPilot into your application. If you’re just getting started, take a look at MainActivity.cs. This is the application’s launcher activity. It demonstrates how to bind to the CoPilot service and how to show the service’s associated view either through a fragment (see CustomFragment.cs) or by simply putting the view on the screen. After binding to the service, you will receive a callback (onCPStartup()) from CoPilot that indicates that the library is ready to receive API calls.

Most of our APIs are demonstrated in the sample app via various fragment classes that each correspond to a different API module. These fragments are controlled by ApiMainActivity.cs. If you have a question about how to use a specific API, look at the module’s fragment to see how to use it properly.

CoPilot Appearing very Dim

It has been noted that in some circumstances the CoPilot UI can appear significantly darker/dimmer than the integrated application. This can be due to the styles.xml settings and easily resolved by adding the following to your styles.xml:

<style name="MyTheme" parent="Theme.AppCompat.Light.NoActionBar">
  <item name="android:backgroundDimEnabled">false</item>
</style>

Last update: June 15, 2020