Thank you for your interest in integrating the CoPilot Navigation Library for Android. The CPIK libraries package includes the following:
- Source code of the sample application
- Sample application APK that can be install on Android device
- Contains all the documents including API reference document
Library & Resource
- Libs/CPIKWrapper.dll : Customer application shall use this library to integrate CPIK libraries
- 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.
Note: When downloading files, be sure to download the latest version of CoPilot and to only include files from that version in your project.
The Xamarin interface is available for the 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.
Open the SampleApp.sln from Sample App/Source Code/SampleApp.sln to Xamarin Studio
It contains all the information required to run i.e library, asset, resources, component etc.
You can run
- Sample APK which can be installed on CoPilot
This is binding library to interface with CoPilot. All the CPIK libraries 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.
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 “
/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.
Copy “Library and Resource/assets” folder into your project. Copy entire assets folder located under “Library and Resource/assets/” to “
/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.
This file contains all required attribute and permission to run the CoPilot. Developer need to merge this information to their existing AndroidManifest.xml.
Integrate the contents of “Library & Resource/AndroidManifest_template.xml” into your application’s AndroidManifest.xml.
Extract the “Library & Resource/assets” folder from the library package into your project (usually “
/assets/). Make sure that entire Copilot folder under Assets are added to Xamarin and set BuildAction to AndroidAsset.
Reference “Library & Resource/libs/ CPIKWrapper.dll” to your project to access all the classes/members of the CPIK libraries library and set BuildAction to AndroidNativeLibrary.
Copy “Library & Resource/Native libs/.” folder to your project’s lib folder (usually “
/lib/.**”). It contains native library for all different architecture.
Develop! Use the included sample application as a guide.
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.
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.
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>