1Overview
2========
3
4The FreeRDP Android port consists of three parts:
5* Android Java GUI (client/Android/Studio)
6* FreeRDP library and its dependencies
7* JNI bindings (client/Android/android_freerdp.c
8  and client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/LibFreeRDP.java)
9
10Build requirements
11=================
12
13For the Android port some additional dependencies need to be fulfilled:
14
15* for JNI
16- CMake >= 3.0
17- Android NDK (>= r9)
18
19* for the Java GUI
20- Android SDK
21
22FreeRDP requires openssl libraries for building but they are not part of the
23Android NDK and therefore they need to be prebuild manually.
24
25For jpeg support https://github.com/akallabeth/jpeg8d has been tested and used.
26However, any other static builds should work as well.
27
28Build native libraries:
29======================
30From the project root run the build script
31./scripts/android-build-freerdp.sh --ndk <ANDROID_NDK> --sdk <ANDROID_SDK>
32Set ANDROID_NDK and ANDROID_SDK to the absolute paths on your machine.
33This will fetch sources from git and build OpenSSL, OpenH264, libJPEG.
34The native FreeRDP libraries will also be build.
35
36Currently the default script builds for:
37* armeabi
38* armeabi-v7a
39* x86
40* mips
41* arm64-v8a
42* x86_64
43* mips64
44
45When the script is finished the libraries are ready for android studio to
46be picked up in client/Android/Studio/freeRDPCore/src/main/jniLibs
47
48The default configuration build configuration can be found in
49./scripts/android-build.conf and is configured to provide debug builds.
50They are limited to API level 21 and above.
51
52If release binaries (and old android API support) are required, build 32 bit architectures with
53./scripts/android-build-freerdp.sh --ndk <ANDROID_NDK> --sdk <ANDROID_SDK> --conf ./scripts/android-build-32.conf
54and 64 bit architectures with
55./scripts/android-build-freerdp.sh --ndk <ANDROID_NDK> --sdk <ANDROID_SDK> --conf ./scripts/android-build-64.conf
56
57Building the APK (Android Studio)
58================
59
60* Import the folder client/Android/Studio in Android Studio
61* You are ready to go
62
63Building the APK (gradle)
64================
65
66* change to directory client/Android/Studio
67* run ./gradlew build to build
68* run ./gradlew tasks for other gradle options
69
70Development
71===========
72
73Updating JNI
74------------
75
76Whenever the FreeRDP API changes or you need some extra functionality in your Java
77GUI the JNI needs to be updated.
78
79The JNI functions are defined in client/Android/android_freerdp.c
80Add the new functions to the methods struct.
81
82* edit client/Android/src/com/freerdp/afreerdp/services/LibFreeRDP.Java to
83  reflect your changes
84* edit client/Android/android_freerdp.c and adjust the methods struct to reflect
85  the changes made.
86
87