-
Notifications
You must be signed in to change notification settings - Fork 42
Developer HOWTO
Welcome to the Litecoin Android Developer HOWTO. This guide will show you how to get started developing this project.
The following environment will be needed:
- Android SDK with SDK API Levels 10+ installed
- IntelliJ IDEA 13 Community Edition (or Ultimate if you want)
- The latest JDK 7
- git (I use the homebrew version on OSX). Any git client will do (commandline, TortoiseGit, etc.) - theoretically you could use the one included with IntelliJ, but you're on your own on setting that up.
- maven 3.1+
To install the android API levels, run the tools/android program from the SDK and select all the checkboxes next to Android 2.3.3 (API 10) up to the latest version. Also check the Android Support Library from the Extras section. Then install all the packages.
If you KNOW you are going to fix something and submit it back to us, you can go ahead and fork the github repository. Read the article here for more information.
The first step is to clone our modified version of bitcoinj:
$ git clone https://github.com/Litecoin-Java/bitcoinj.git
Cloning into 'bitcoinj'...
remote: Counting objects: 22028, done.
remote: Compressing objects: 100% (6359/6359), done.
remote: Total 22028 (delta 9536), reused 22028 (delta 9536)
Receiving objects: 100% (22028/22028), 7.65 MiB | 310.00 KiB/s, done.
Resolving deltas: 100% (9536/9536), done.
Checking connectivity... done
Now, clone the android repository with git. If you forked in the previous step, substitute your new clone URL for ours:
$ git clone https://github.com/Litecoin-Java/bitcoin-wallet.git
Cloning into 'bitcoin-wallet'...
remote: Counting objects: 18533, done.
remote: Compressing objects: 100% (4309/4309), done.
remote: Total 18533 (delta 10666), reused 18491 (delta 10624)
Receiving objects: 100% (18533/18533), 22.24 MiB | 199.00 KiB/s, done.
Resolving deltas: 100% (10666/10666), done.
Checking connectivity... done
Import the litecoinj repository into IntelliJ as a maven project. The default import settings are usually fine, but look them over to make sure they make sense in your environment. After the project is created, create a maven build configuration that runs clean install. This will clean, test, and install litecoinj into your local maven repository. If you want to skip unit tests (faster, but doesn't verify litecoinj will work), you can use the Skip Tests checkbox in the Runner tab in your configuration.
Run the build configuration, and the console in IntelliJ should eventually display the following:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] bitcoinj Parent ................................... SUCCESS [0.590s]
[INFO] bitcoinj .......................................... SUCCESS [1:26.091s]
[INFO] bitcoinj Examples ................................. SUCCESS [1.592s]
[INFO] bitcoinj Tools .................................... SUCCESS [3.664s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:32.389s
[INFO] Finished at: Sun Jan 19 11:49:19 EST 2014
[INFO] Final Memory: 36M/532M
[INFO] ------------------------------------------------------------------------
Process finished with exit code 0
Now that litecoinj is installed in your maven repository, you can build the android project. Import it into IntelliJ as a maven project, and pick the android profile during the import. This will enable all the IntelliJ android features for the project. Once it's imported, create a build configuration that does Deploy Default APK and Launch Default Activity for the wallet module. You can use USB or emulator for your target. Once you have that, try building.
At this point, the app should run on whatever device you chose to deploy it on.
If you fork the repository and make changes you think are production-ready (or at least in some state of done-ness), feel free to submit a pull request to us using these instructions.
If you have problems building and you can't solve them yourself, feel free to make a ticket and we'll help you as much as we can. You can also email me (hank) directly - hank a^t jointsecurityarea DAAT org