*Independent Test *
Shows MarketPrice for Bitcoins
This chapter describes how to build APK with Gradle and prepare app for publishing.
You don't need to install Gradle on your system, because there is a Gradle Wrapper. The wrapper is a batch script on Windows, and a shell script for other operating systems. When you start a Gradle build via the wrapper, Gradle will be automatically downloaded and used to run the build.
- Clone this repository
- Open configuration file /app/src/main/java/com/number26/bitcointest/util/ConfigUtils.java and set constants as required (see below for more info)
- Open main build script /app/build.gradle and set constants and config fields as required (see below for more info)
- Run
gradlew assemble
in console - APK should be available in /app/build/outputs/apk directory
Note: You will also need a "local.properties" file to set the location of the SDK in the same way that the existing SDK requires, using the "sdk.dir" property. Example of "local.properties" on Windows: sdk.dir=C:\\adt-bundle-windows\\sdk
. Alternatively, you can set an environment variable called "ANDROID_HOME".
Tip: Command gradlew assemble
builds both - debug and release APK. You can use gradlew assembleDebug
to build debug APK. You can use gradlew assembleRelease
to build release APK. Debug APK is signed by debug keystore. Release APK is signed by own keystore, stored in /extras/keystore directory.
Signing process: Keystore passwords are automatically loaded from property file during building the release APK. Path to this file is defined in "keystore.properties" property in "gradle.properties" file. If this property or the file does not exist, user is asked for passwords explicitly.
This is the main configuration file and there are some important constants: addresses to API endpoints, etc. Make sure that all constants are set up properly.
This is the main build script and there are 4 important constants for defining version code and version name.
- VERSION_MAJOR
- VERSION_MINOR
- VERSION_PATCH
- VERSION_BUILD
See Versioning Your Applications in Android documentation for more info.
There are also a build config fields in this script. Check "buildTypes" configuration and make sure that all fields are set up properly for debug and release. It is very important to correctly set these true/false switches before building the APK.
- LOGS - true for showing logs
- DEV_API - true for development API endpoint
Important: Following configuration should be used for release build type, intended for publishing on Google Play:
buildConfigField "boolean", "LOGS", "false"
buildConfigField "boolean", "DEV_API", "false"
- Android Support Library v4
- AppCompat
- Android Support Design
- rxjava
- rxjava android
- Retrofit2
- stateful-layout
- mockito
- Espresso
- Test by runing in mock flavour the JUnit test on the class: /Users/olsisaqe/androidstudioworkspace/BitcoinTest/app/src/test/java/com/number26/bitcointest/BitcoinGraphPresenterTest.java
- Test UI for the moment not implemented
- Test app on different Android versions (handset, tablet)
- Test overdraws
- Test offline/empty/progress states
- Set proper versions in the main build script
- Check build config fields in the main build script
- Update text info in changelog/about/help