Quote:
Koreader is relatively new to Android, and doesn't work well on every device out there, yet.
|
Thanks for that pointer -- I didn't realize you could just compile Koreader for Android! I'm happy to report that it indeed does work on the Galaxy S4. It's a bit slow and I've had some weird crashes, but that might just be because I did something wrong with the compilation.
edit: I just saw that you posted a link to a binary release, ouch. Never mind the instructions below, then.
In case somebody else wants to attempt the compilation (this was Kubuntu 15.04): I tried to follow the instructions on
GitHub to the letter, though some tinkering was needed. Here's a quick gist:
1. Install all the recommended packages, there's a convenient list on the github page.
2. Download the
Android NDK and SDK
3. Setup your environment variables. You need to set
- $NDK to the root of the NDK directory
- include a bunch of directories in your $PATH variable. In the end, I had:
Code:
/opt/Android/Ndk
/opt/Android/Ndk/build-tools
/opt/Android/Ndk/build-tools/21.1.2
/opt/Sdk/build-tools/21.1.2/
/opt/Android/Sdk/tools/android
/opt/Android/Sdk/tools/
/opt/Android/Ndk/android-ndk-r10e/
3. Clone the repository from the github page
Code:
git clone https://github.com/koreader/koreader.git koreader
4. Fetch the dependencies:
Code:
cd koreader
make fetchthirdparty
5. At this point, I had to patch some of the scripts. In 'base/Makefile' I had to add ' --toolchain=arm-linux-androideabi-4.8' to the android-toolchain target (lines 607--610), the changed target looks like this:
Code:
android-toolchain:
mkdir -p $(ANDROID_TOOLCHAIN)
$(NDK)/build/tools/make-standalone-toolchain.sh -platform=android-9 \
--toolchain=arm-linux-androideabi-4.8 --install-dir=$(ANDROID_TOOLCHAIN)
You can see which toolchains are available on your computer in the 'toolchains' subdirectory of your NDK. I don't know if 'arm-linux-androideabi-4.8' is the right toolchain for all smartphones.
6. The toolchain is hardcoded as 'arm-linux-androideabi-4.6' into koreader/platform/android/luajit-launcher/mk-luajit.sh, so I changed all four occurences of 'arm-linux-androideabi-4.6' in that file into 'arm-linux-androideabi-4.8'. If you choose a different toolchain in step 5, you will need to change the script accordingly, I guess.
7. In koreader/platform/android/luajit-launcher/Makefile, I had to add '--target android-21' to line 5, so the new line reads
Code:
android update project --target android-21 --path .
The number in 'android-21' specifies the SDK level of the Android running on your smartphone, SDK level 21 is Lollipop (5.0).
8. Now you're good to go, do a
Code:
make android-toolchain
make TARGET=android clean androidupdate
in the root directory.
9. This should give you an *.apk file in the root directory that can be installed on the smartphone.
The app takes a long time to load on my phone, so it might look as if it is crashed (just shows a black screen), but in fact, it comes up after a while.