Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Android library for accessing vehicle data from an OpenXC vehicle interface
Java

README.mkd

OpenXC Android Library

Build Status

Coverage Status

Stories in Ready

This library is a part of the OpenXC project.

This Android library contains the tools required to read vehicle data from the vehicle's CAN bus through the OpenXC vehicle interface in any Android application.

Visit the OpenXC project page for installation instructions, usage details and the source code documentation.

Building from Eclipse

After cloning the openxc-android repository to your local disk, open Eclipse and go to File -> New -> Other -> Android -> Android Project from Existing Source. Browse to the openxc-android folder and it should detect the 4 Android projects within the repository. At the minimum, add the openxc project (the Android library itself) and OpenXcEnablerActivity (the Enabler app, required to run OpenXC applications).

Tests

To run the unit tests suite:

$ mvn test -pl openxc

To generate a code coverage report for the test suite:

$ mvn cobertura:cobertura -pl openxc

To run the instrumentation tests (must have an attached Android device or emulator):

$ mvn install -pl openxc -am
$ mvn install -pl openxc-it

Building from Command Line

The build requires Maven v3.0.3+ and the Android SDK to be installed in your development environment.

Set the ANDROID_HOME environment variable to the location of your SDK:

export ANDROID_HOME=/opt/tools/android-sdk

Clone the maven-android-sdk-deployer tool and install the SDK to your local Maven repository for the latest SDK:

$ git clone git@github.com:mosabua/maven-android-sdk-deployer.git
$ cd maven-android-sdk-deployer
$ mvn install -P 5.0

Support Library

You also need the Android support library, but unfortunately Google doesn't deploy the latest versions of this to the the Central Maven repository. Instead, you must open the Android SDK manager and install the "Android Support Repository" package (under "Extras"). Next, open a terminal and navigate to your SDK's top-level directory (e.g. /home/user/android-sdk.

You must manually copy the Maven artifacts from this folder to your local repository:

$ cp -R $ANDROID_HOME/extras/android/m2repository/com ~/.m2/repository

After satisfying those requirements, the build is pretty simple:

To compile the OpenXC library as an APKLIB and install it to your local Maven repository:

$ mvn install -pl openxc -am

To compile and build and APK for the Enabler app (that uses the OpenXC library):

$ mvn package -pl enabler

Finally, to deploy the packaged APK to an attached Android device and run it:

$ mvn android:deploy android:run -pl enabler
  • Run mvn clean install -pl openxc,openxc-it -am from the root directory to build and run the library and test suite. This requires that an Android device is attached or an emulator is running.

If you want the tests to wait for a debugger to attach, change the testDebug setting in openxc-android/pom.xml to true.

Automatic Crash Reporting

The Enabler includes optional support for automatic crash reporting via Bugsnag. If you wish to enable this, create a resources file in enabler/res/values with your Bugsnag token, e.g.:

<?xml version="1.0" encoding="utf-8"?> 0123456789

If no token is found, Bugsnag will not be included in the build.

The APK files upload to the GitHub releases page are built with Bugsnag included, reporting to an accout that the OpenXC maintainers can review to improve the project. If you wish to not have any crash reports collected from your device, please build the Enabler from the source code.

Contributing

Please see our Contribution Documents.

License

Copyright (c) 2011-2013 Ford Motor Company Licensed under the BSD license.

Something went wrong with that request. Please try again.