|
Packit |
1fb8d4 |
Overview
|
|
Packit |
1fb8d4 |
========
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
The FreeRDP Android port consists of three parts:
|
|
Packit |
1fb8d4 |
* Android Java GUI (client/Android/Studio)
|
|
Packit |
1fb8d4 |
* FreeRDP library and its dependencies
|
|
Packit |
1fb8d4 |
* JNI bindings (client/Android/android_freerdp.c
|
|
Packit |
1fb8d4 |
and client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/LibFreeRDP.java)
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
Build requirements
|
|
Packit |
1fb8d4 |
=================
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
For the Android port some additional dependencies need to be fulfilled:
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
* for JNI
|
|
Packit |
1fb8d4 |
- CMake >= 3.0
|
|
Packit |
1fb8d4 |
- Android NDK (>= r9)
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
* for the Java GUI
|
|
Packit |
1fb8d4 |
- Android SDK
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
FreeRDP requires openssl libraries for building but they are not part of the
|
|
Packit |
1fb8d4 |
Android NDK and therefore they need to be prebuild manually.
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
For jpeg support https://github.com/akallabeth/jpeg8d has been tested and used.
|
|
Packit |
1fb8d4 |
However, any other static builds should work as well.
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
Build native libraries:
|
|
Packit |
1fb8d4 |
======================
|
|
Packit |
1fb8d4 |
From the project root run the build script
|
|
Packit |
1fb8d4 |
./scripts/android-build-freerdp.sh --ndk <ANDROID_NDK> --sdk <ANDROID_SDK>
|
|
Packit |
1fb8d4 |
Set ANDROID_NDK and ANDROID_SDK to the absolute paths on your machine.
|
|
Packit |
1fb8d4 |
This will fetch sources from git and build OpenSSL, OpenH264, libJPEG.
|
|
Packit |
1fb8d4 |
The native FreeRDP libraries will also be build.
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
Currently the default script builds for:
|
|
Packit |
1fb8d4 |
* armeabi
|
|
Packit |
1fb8d4 |
* armeabi-v7a
|
|
Packit |
1fb8d4 |
* x86
|
|
Packit |
1fb8d4 |
* mips
|
|
Packit |
1fb8d4 |
* arm64-v8a
|
|
Packit |
1fb8d4 |
* x86_64
|
|
Packit |
1fb8d4 |
* mips64
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
When the script is finished the libraries are ready for android studio to
|
|
Packit |
1fb8d4 |
be picked up in client/Android/Studio/freeRDPCore/src/main/jniLibs
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
The default configuration build configuration can be found in
|
|
Packit |
1fb8d4 |
./scripts/android-build.conf and is configured to provide debug builds.
|
|
Packit |
1fb8d4 |
They are limited to API level 21 and above.
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
If release binaries (and old android API support) are required, build 32 bit architectures with
|
|
Packit |
1fb8d4 |
./scripts/android-build-freerdp.sh --ndk <ANDROID_NDK> --sdk <ANDROID_SDK> --conf ./scripts/android-build-32.conf
|
|
Packit |
1fb8d4 |
and 64 bit architectures with
|
|
Packit |
1fb8d4 |
./scripts/android-build-freerdp.sh --ndk <ANDROID_NDK> --sdk <ANDROID_SDK> --conf ./scripts/android-build-64.conf
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
Building the APK (Android Studio)
|
|
Packit |
1fb8d4 |
================
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
* Import the folder client/Android/Studio in Android Studio
|
|
Packit |
1fb8d4 |
* You are ready to go
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
Building the APK (gradle)
|
|
Packit |
1fb8d4 |
================
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
* change to directory client/Android/Studio
|
|
Packit |
1fb8d4 |
* run ./gradlew build to build
|
|
Packit |
1fb8d4 |
* run ./gradlew tasks for other gradle options
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
Development
|
|
Packit |
1fb8d4 |
===========
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
Updating JNI
|
|
Packit |
1fb8d4 |
------------
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
Whenever the FreeRDP API changes or you need some extra functionality in your Java
|
|
Packit |
1fb8d4 |
GUI the JNI needs to be updated.
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
The JNI functions are defined in client/Android/android_freerdp.c
|
|
Packit |
1fb8d4 |
Add the new functions to the methods struct.
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
* edit client/Android/src/com/freerdp/afreerdp/services/LibFreeRDP.Java to
|
|
Packit |
1fb8d4 |
reflect your changes
|
|
Packit |
1fb8d4 |
* edit client/Android/android_freerdp.c and adjust the methods struct to reflect
|
|
Packit |
1fb8d4 |
the changes made.
|
|
Packit |
1fb8d4 |
|