/android-circleci-base

My Android base with CircleCI for running tests

Primary LanguageJavaMIT LicenseMIT

android-circleci-base

CircleCI

This repository contains my Android base code which can be used to build other Android applications. It has an integration to CircleCI.

Development Requirements

  • Android SDK
  • Android Studio 1.0+
  • Android 4.0+
  • Git
  • CircleCI account (free for public repositories)

Directory Structure

├── assets
|
├── java/freedomofkeima/androidbase
|   ├── activity
|   |   └── MainActivity.java
|   ├── adapter
|   ├── exception
|   ├── fragment
|   ├── helper
|   |   ├── AsyncTaskResult.java
|   |   ├── IAsyncTaskOwner.java
|   |   ├── PreferencesManager.java
|   |   └── VersionHelper.java
|   ├── model
|   ├── task
|   |   └── ExampleTask.java
|   ├── Constants.java
|   └── FreedomofkeimaApplication.java
|
└── res

How to Release

You need to configure following values in gradle.properties and update your build.gradle file.

productKeyStore=
productKeyStorePassword=
productKeyAlias=
productKeyAliasPassword=

Unit Test

By using Android SDK, you can create a new AVD (let's say, the name is testing), and run the following command to run it:

$ emulator -avd testing -no-audio -no-window -no-boot-anim

The entire process may take up to 5 minutes.

You can run unit tests locally by:

$ ./gradlew -i connectedAndroidTest --stacktrace

Additional Information

CircleCI sometimes throws an exception com.android.ddmlib.ShellCommandUnresponsiveException. It may take 5 - 10 minutes until we can use the AVD for testing (for time being, we circumvented it with sleep: 300). If this problem occurs, you need to press rebuild it again.

Guidelines:

Other references for application design:

Other references for security design:

License

MIT License.

Last Updated: June 14, 2016