AWS Mobile Blog

Building the AWS SDK for Android from Source

by Bob Kinney | on | Permalink | Comments |  Share

Version 2 of the AWS Mobile SDK

  • This article and sample apply to Version 1 of the AWS Mobile SDK. If you are building new apps, we recommend you use Version 2. For details, please visit the AWS Mobile SDK page.
  • This content is being maintained for historical reference.

Did you know that the source code for the AWS SDK for Android is distributed both in the .zip file as well as on GitHub? The code is offered under the Apache License, version 2.0 and is available for reuse in your own projects. We welcome submissions for bug fixes and enhancements that will help the entire community of AWS developers.

To that end, we’ve tried to make it easy for you to build the AWS SDK for Android from source so you can test out any of your own modifications. We provide one method below, but please feel free to comment below if you would like to tell us how you use the SDK source in your own project.

Building using Maven

Distributed with the SDK source is a pom.xml file. This is Project Object Model, a description of the SDK used by the Apache Maven tool. You must have already configured Apache Maven on your system before using this file. If you use Mac OS X 10.5 (Leopard) or later, you will not have to take any additional steps as Maven is already included. However, if you use the Windows or Linux operating systems, you should refer to the Running Maven page for details on setting up Maven on your system. Any recent version of Maven 2 or 3 should work with the supplied pom.xml.

Once you’ve installed and configured Maven, simply go to a terminal, cd to the directory where you downloaded the SDK source (where pom.xml is located), and simply type the following command:

 

mvn package

 

Maven will then download all necessary dependencies and compile a .jar that is compatible with the .jar distributed in the SDK download. The aws-android-sdk-X.X.X.jar (where X.X.X is the current version of the SDK) will be located in the target directory. The rest of the contents of the target directory are the intermediate files from the build and can be ignored or deleted.

We encourage you to send us a pull request on GitHub. Please leave a comment below and tell us how you use the SDK and/or what modifications you’ve made.