Contributing to AnkiDroid
Non-technical tasks
Translate AnkiDroid to the languages you know: AnkiDroidInternationalization.
Improve the Wiki, especially the screenshots.
Here is a list of tasks that can be done by people who can't code.
Blog about AnkiDroid and spread the word
Android development environment
If it is your first time developing for Android, please follow these instructions.
Source code
First, register at Github.com, open Nicolas Raoul's repository page and follow the forking instructions.
If you have trouble with Git, you can also download a ZIP of the latest source code here.
src/com/ichi2/anki contains the main source code. Anki.java is the opening screen, FlashCard.java is the flash card window, and AnkiDb.java is a poor database layer implementation
- assets/flashcard_css contains the CSS file included with each flash card
- values/strings.xml contains app strings, whiteboard colors, and a basic HTML template for flashcards.
- assets/layout contains the layouts for each screen.
Compiling with Eclipse
In order to open the codebase as an Eclipse project, after you have followed the Android environment setup instructions at the link above, follow these steps:
File -> New -> Project
Select the "Android -> Android Project" option in the "New Project" dialog and click next.
- Select the "Create project from existing source" radio button and set the "Location:" field to your local git fork directory (Anki-Android).
- Check the "Android 1.6" checkbox in the Build Target section. Checking the wrong version (i.e. Android 1.5) may result in an error such as the compiler not being able to find com.ichi2.anki.R.
- Click "Finish". The project should be up and running in Eclipse!
To run/debug in the Android Emulator, create a new Android 1.6 virtual device in the "Window -> Android SDK and AVD Manger" screen.
Compiling with Ant (optional)
(If you use Eclipse you can skip this step)
- In the top level directory, create a "local.properties" file containing the path to the Android SDK, for instance:
sdk.dir=/home/nico/programs/android-sdk
- Plug in your Android phone via USB and run the following command:
ant install-device
- To install on an emulator run:
ant install-emulator
Other development tools
A tool like "SQLite Database Browser" is very useful to understand how a ".anki" file is made, and to test SQL queries. To install it on Ubuntu: sudo apt-get install sqlitebrowser
Submit improvements
Once you have improved the code, commit it and send a push request to Nicolas Raoul, who will integrate it and publish the enhanced application on the Android Market.
If you have trouble with Git, you can send your modifications as an attachement to a bug in the issue tracker, or just paste the changed files as text to the forum.
Checking database modifications
On Ubuntu Linux:
- Install sqlite3 and meld: sudo apt-get install sqlite3 meld
- Make sure my desktop and android have about the same clock time.
- Copy country-capitals.anki to both
- Perform the same review sequence on both at the same time.
- Copy the modified decks for comparizon.
- Run:
echo .dump | sqlite3 country-capitals.desktop.anki >desktop.dump echo .dump | sqlite3 country-capitals.android.anki >android.dump diff desktop.dump android.dump > desktop-android.diff meld desktop.dump android.dump
- Check that time are not too different, and notice any other difference.
If you need the emulator
If you don't have an Android device, you can download the emulator to try it out. The SDK has a tools direcory with a ready-to-run emulator and tools. In Linux/OSX, you can cd to the tools directory and use these commands to set up the environment:
- First, create an sdcard with:
- [Linux]
- mkdir -p ~/.android/SDK-1.0/
- ./mksdcard 128M ~/.android/SDK-1.0/sdcard.img
mkdir C:\Documents and Settings\<user>\Local Settings\Application Data\Android\SDK-1.0 mksdcard 128M C:\Documents and Settings\<user>\Local Settings\Application Data\Android\SDK-1.0\sdcard.img
- [Linux]
- Run the emulator (note that the setup takes a while the first time):
- [Linux]
- ./emulator
- emulator
- ./emulator -sdcard ~/myproject/mysdcard.img
- [Linux]
- Wait for the emulator to finish loading so adb can communicate with it. Download the apk file linked above and install with:
- ./adb install -r ~/path/to/anki.apk
- Copy one of your decks to the sdcard:
- ./adb push ~/path/to/your-deck.anki /sdcard
- In the emulator window, click the grey menu bar at the bottom of the screen. You should see 'Anki' listed as an installed app.
Preparing for publication
Note: This paragraph describes how to prepare an APK for publication. Most developers do not need to bother with this.
According to Google, we should remove all Log calls before publishing. Here is a script to comment all Log calls:
find . -name '*\.java' | xargs grep -l 'Log\.' | xargs sed -i -e 's/Log\./\/\/ Log\./g' After publication, to uncomment the Log calls: find . -name '*\.java' | xargs grep -l 'Log\.' | xargs sed -i
Contributors
Thanks to these AnkiDroid contributors and to all of the anonymous contributors/testers/enthusiasts!
If you contributed to AnkiDroid, don't hesitate to add your name to this page!
Similar Android applications
StudyDroid Closed source.
Chinese flashcards Apparently plans to make it 1.99$, but free right now.
Tea.ch Cards Light Closed source.
Brainy Baby Flashcards Demo, full version for 1.49$
