-
Notifications
You must be signed in to change notification settings - Fork 103
Getting started with the code
You need to get the code first before you can do anything. Clone it from here:
$ git clone git://github.com/ubergeek42/weechat-android.git
If you don't want to use eclipse, or want to automate the build process, you can use gradle.(This is how the official releases are created.)
For this you need to download the Android SDK from here: https://developer.android.com/sdk/index.html (the one without ADT is enough). Extract the zip to a directory named android-sdk-linux
with tools
as a subdirectory and run the below to install the dependencies:
$ export ANDROID_HOME=/path/to/android-sdk-linux
$ ./android-sdk-linux/tools/android update sdk --no-ui -a --filter build-tools-25.0.2,platform-tools,android-23,extra-android-support,extra-google-m2repository,extra-android-m2repository
All you should need to do is run something like:
$ ./gradlew
Which will produce an weechat-android-debug.apk
file in weechat-android/build/outputs/apk/
Eclipse is a lot more useful than running maven from the command line, and since it is one of the more popular IDE's for java development I've included the steps below to get it working. These were tested with Eclipse Juno(4.2), but I believe it should be working with Indigo(3.7) as well.
Since the maven integration for android apklib's isn't 100% working properly, we have a little bit of setup to do. Download actionbarsherlock, and extract it somewhere on your disk. We will be needing the library/ directory. We also need ViewPagerIndicator, and we get it in the same manner.
$ curl -L https://github.com/JakeWharton/ActionBarSherlock/tarball/4.1.0 | tar -zx
$ curl -L https://github.com/JakeWharton/Android-ViewPagerIndicator/tarball/master | tar -zx
- Start eclipse. Choose any directory you wish for your workspace.
- File->New->Other
- Under Android, choose "Android Project from Existing Code"
- Point the root directory to the
library
directory inside the actionbarsherlock directory. - Finish
- Edit the project properties, and go to the "Java Compiler" section. Make sure the Compiler Compliance Level is set to 1.6.
- In eclipse, File->New->Other.
- Under Android, choose "Android project from existing code"
- Point the root directory to the
library
directory inside the viewpagerindicator directory. - Finish.
- Edit the project properties, and go to the "Java Compiler" section. Make sure the Compiler Compliance Level is set to 1.6.
It might be nice to rename the two imported libraries to have real names. Right click on the project and select Refactor->Rename. Choose something more reasonable than 'library'.
- File->Import...
- Under Maven, select "Existing Maven Projects"
- Point the root directory to where you cloned the weechat-android repository.
- Unselect the parent pom.xml, then select only the weechat-relay, and weechat-android projects to import for now.(There should only be 2 things checked)
- Finish
- Edit the project properties for weechat-android. Under the "Android" section, remove any "Library" entries from the bottom, then click "Add..." and choose the actionbarsherlock library project we imported earlier. Repeat for the viewpagerindicator library.
- Force a clean/rebuild of the workspace: Project->Clean.
- Verify that there are no errors under the "Problems" tab.
Eclipse gets confused sometimes. Force a rebuild by choosing Project->Clean.
Any other problems?
File an issue, send me an email, or join our (small) channel on freenode, #weechat-android.