summaryrefslogtreecommitdiffstats
path: root/packaging/android/README
blob: f822e7f0c302db89a26352d8b014159af2099b61 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Tool repo to crosscompile subsurface to android-arm
---------------------------------------------------

Dependencies:

1. android_sdk, android_ndk and Qt for android. See step 0.
2. cmake
3. ant
4. Java JDK
5. working adb is recommended
6. dependencies of libdivecomputer and subsurface -
   visit http://subsurface.hohndel.org/documentation/building/

By far the easiest way to do this is using the Android build container which is
used to create the official builds. That has all the dependencies ready and
makes things a lot easier.

Run the docker image: docker://subsurface/android-builder:5.13.10

Check out the sources inside the container, make sure the following links
are available in parallel to the source directory

        ln -s /android/Qt .
        ln -s /android/android-ndk-r18b .
        ln -s /android/android-sdk-linux .

and run the build wrapper from the directory above the source directory

        bash -x subsurface/packaging/android/android-build-wrapper.sh

This should create a pair of unsigned but otherwise working APKs (for 32 and 64
bit ARM).

Alternatively, steps to install using your own Linux machine:

Step 0.
Grab..
Android ndk from: http://developer.android.com/tools/sdk/ndk/index.html
Android sdk from: http://developer.android.com/sdk/index.html#download
And QT for android from: http://qt-project.org/downloads

Step 1.
Extract and install these into known directories.
Have a look in the top of build.sh for where the cross build tool expects
them. By default thats is: ../../../android-ndk-r9d ../../../android-sdk-linux
and ../../../Qt/5.5 (or Qt/5.6)

Step 2.
Run bash build.sh in the terminal. By default it builds for arm but you
can pass x86 as first arg to build.sh to have it build for x86. Nice when
debugging in a fast emulator.
The script will download and build the whole dependency chain.

After this, subsurface will be built for android.

The output folder is subsurface-build-arm/android_build and your newly
created apk shows up as:
subsurface-build-arm/android_build/bin/QtApp-debug.apk

Where the x86 apk shows up when built for x86 is left as a exercise for the
reader.