sfl android | 42fcf7a | 2012-08-06 15:45:32 -0400 | [diff] [blame] | 1 | This repository is meant for the porting of SFLphone to Android. |
| 2 | |
| 3 | |
| 4 | To build SFLphone and all its dependencies, make sure that Android's NDK and SDK |
| 5 | are properly installed on your system. |
| 6 | |
| 7 | You have also to make sure that the following environment variables are defined: |
| 8 | |
Tristan Matthews | d8aa432 | 2013-07-17 10:51:54 -0400 | [diff] [blame] | 9 | export ANDROID_NDK=$HOME/path/to/android-ndk-r*b |
| 10 | export ANDROID_SDK=$HOME/path/to/android-sdk-linux |
sfl android | 42fcf7a | 2012-08-06 15:45:32 -0400 | [diff] [blame] | 11 | |
| 12 | The path to the required Android's build executable must be also specified: |
| 13 | |
| 14 | export PATH=$PATH:$ANDROID_NDK |
Emeric Vigier | 9701e03 | 2012-09-12 12:38:01 -0400 | [diff] [blame] | 15 | |
| 16 | BUILD |
| 17 | ----- |
Emeric Vigier | cca7f56 | 2012-09-20 14:22:30 -0400 | [diff] [blame] | 18 | install swig-2.0.6 or later and python-2.7 or later on your system |
Emeric Vigier | 9701e03 | 2012-09-12 12:38:01 -0400 | [diff] [blame] | 19 | |
| 20 | $ cd sflphone-android |
| 21 | |
| 22 | Check that following files are executable: |
| 23 | jni/sflphone/daemon/src/JavaJNI2CJNI_Load.py |
| 24 | make-swig.sh |
| 25 | |
Adrien Béraud | 432f067 | 2013-02-27 17:06:36 -0500 | [diff] [blame] | 26 | Compile pjsip-android |
Alexandre Lision | 7c6f4a6 | 2013-09-05 13:27:01 -0400 | [diff] [blame] | 27 | $ pushd jni/pjproject-android/ |
Alexandre Lision | 39ec4cd | 2014-01-27 13:51:33 -0500 | [diff] [blame] | 28 | $ make realclean |
Alexandre Lision | 0849410 | 2014-01-24 15:17:04 -0500 | [diff] [blame] | 29 | $ TARGET_ABI=armeabi-v7a ./configure-android-patched --use-ndk-cflags --disable-sound --disable-oss --disable-video --enable-ext-sound --disable-speex-aec --disable-g711-codec --disable-l16-codec --disable-gsm-codec --disable-g722-codec --disable-g7221-codec --disable-speex-codec --disable-ilbc-codec --disable-sdl --disable-ffmpeg --disable-v4l2 |
alision | f76de3b | 2013-04-16 15:35:22 -0400 | [diff] [blame] | 30 | $ make dep && make |
| 31 | $ popd |
| 32 | |
Adrien Béraud | 5c12b3b | 2014-01-28 10:56:03 -0500 | [diff] [blame] | 33 | Configure deamon for Android |
Adrien Béraud | c232fdb | 2014-01-28 11:12:07 -0500 | [diff] [blame] | 34 | $ pushd jni/sflphone/daemon/ |
| 35 | $ ./configure-android.sh |
Adrien Béraud | 5c12b3b | 2014-01-28 10:56:03 -0500 | [diff] [blame] | 36 | $ popd |
alision | f76de3b | 2013-04-16 15:35:22 -0400 | [diff] [blame] | 37 | |
| 38 | Generate dbus interface |
Alexandre Lision | 7c6f4a6 | 2013-09-05 13:27:01 -0400 | [diff] [blame] | 39 | $ ./make-swig.sh |
| 40 | |
Adrien Béraud | c232fdb | 2014-01-28 11:12:07 -0500 | [diff] [blame] | 41 | $ pushd jni/ |
Alexandre Lision | 0849410 | 2014-01-24 15:17:04 -0500 | [diff] [blame] | 42 | $ ndk-build APP_ABI=armeabi-v7a -j4 |
Adrien Béraud | c232fdb | 2014-01-28 11:12:07 -0500 | [diff] [blame] | 43 | $ popd |
Emeric Vigier | 9701e03 | 2012-09-12 12:38:01 -0400 | [diff] [blame] | 44 | |
Emeric Vigier | c30b71d | 2012-09-12 14:51:47 -0400 | [diff] [blame] | 45 | Check that no errors occurred. In particular, following files should have been generated by make-swig.sh: |
Emeric Vigier | 9701e03 | 2012-09-12 12:38:01 -0400 | [diff] [blame] | 46 | sflphoneservice_loader.c |
| 47 | callmanager_wrap.cpp |
| 48 | sflphoneservice.java |
| 49 | sflphoneserviceJNI.java |
| 50 | ManagerImpl.java |
| 51 | |
alision | f76de3b | 2013-04-16 15:35:22 -0400 | [diff] [blame] | 52 | |
Alexandre Lision | 0fbcc4e | 2014-01-22 13:02:28 -0500 | [diff] [blame] | 53 | Then build android project with your favorite JDK: eclipse, intellijidea or ant. |
| 54 | |
| 55 | |
| 56 | |
| 57 | ************************** GENYMOTION HOW TO ************************* |
| 58 | |
| 59 | Genymotion is an open source project to run Android VMs with standard images (Nexus, 4, 7, 10, Xperia etc.) on top of VirtualBox. |
| 60 | |
| 61 | www.genymotion.com/ |
| 62 | |
| 63 | Pros: |
| 64 | - Very fast |
| 65 | - Integrated to IDEs (tested with IntellijIDEA) |
| 66 | - Can be integrated in jenkins as well |
Alexandre Lision | 39ec4cd | 2014-01-27 13:51:33 -0500 | [diff] [blame] | 67 | - Offers 20+ different devices |
Alexandre Lision | 0fbcc4e | 2014-01-22 13:02:28 -0500 | [diff] [blame] | 68 | |
| 69 | Cons: |
| 70 | - Not actually a negative point, but as it is based on VirtualBox, these Vms needs x86 images to run. SFLphone is only built for arm arch, and needs to be recompiled for x86. |
| 71 | This concerns only the JNI part of the project. |
| 72 | |
Alexandre Lision | 8538238 | 2014-01-27 15:54:16 -0500 | [diff] [blame] | 73 | Android provides an option APP_ABI parameter, defining for which arch it is built (it can be more than one at the same time) |
Alexandre Lision | 0849410 | 2014-01-24 15:17:04 -0500 | [diff] [blame] | 74 | |
| 75 | Issue: Pjsip uses a custom build system, and does not support parallel builds. So each time you want to switch arm/x86, pjsip needs to be recompiled using |
| 76 | |
Alexandre Lision | 8538238 | 2014-01-27 15:54:16 -0500 | [diff] [blame] | 77 | $ make realclean |
Alexandre Lision | 0849410 | 2014-01-24 15:17:04 -0500 | [diff] [blame] | 78 | $ TARGET_ABI=INSERT_ARCH_HERE ./configure-android-patched --use-ndk-cflags --disable-sound --disable-oss --disable-video --enable-ext-sound --disable-speex-aec --disable-g711-codec --disable-l16-codec --disable-gsm-codec --disable-g722-codec --disable-g7221-codec --disable-speex-codec --disable-ilbc-codec --disable-sdl --disable-ffmpeg --disable-v4l2 |
| 79 | |
| 80 | And don't forget to rebuild the rest of the JNI project with: |
Alexandre Lision | 39ec4cd | 2014-01-27 13:51:33 -0500 | [diff] [blame] | 81 | $ ndk-build APP_ABI=INSERT_ARCH_HERE -j4 |
Alexandre Lision | 0849410 | 2014-01-24 15:17:04 -0500 | [diff] [blame] | 82 | |
Alexandre Lision | 0fbcc4e | 2014-01-22 13:02:28 -0500 | [diff] [blame] | 83 | |
| 84 | Notes: |
| 85 | |
| 86 | - Using SFLphone on VMs: |
| 87 | By default, Android VMs are in their own virtual NAT, which blocks RTP communications in SFLphone. To be more precise, RTP stream will work FROM the VM to the outside, but it won't be able to receive incoming streams. |
| 88 | |
| 89 | To solve that problem, you need to change VirtualBox settings of the Android VMs. |
| 90 | After creating a VM with Genymotion wizard, open VirtualBox. You should see that the VM appears there (the factory-backup). Right-click on it -> Settings. |
| 91 | |
| 92 | In the network panel, leave the first Adapter as it is (Host-only, vboxnet0). |
| 93 | In the second adapter tab, switch NAT, to Bridged Adapter. |
| 94 | |
| 95 | Now, when running your Android VM, you should have an IP adress on the same NAT as your desktop, allowing data streams to be correctly sent TO/FROM your VM. |
Alexandre Lision | 0849410 | 2014-01-24 15:17:04 -0500 | [diff] [blame] | 96 | |
| 97 | |
Alexandre Lision | 39ec4cd | 2014-01-27 13:51:33 -0500 | [diff] [blame] | 98 | |
| 99 | ************************** JENKINS HOW TO ************************* |
| 100 | |
| 101 | |
| 102 | SFLphone android uses jenkins to run tests on genymotions emulators. |
| 103 | |
| 104 | To manage available emulators: |
| 105 | |
| 106 | - start ssh graphical session as jenkins user: ssh -X jenkins@hostname |
| 107 | - enter jenkins password (availbale in sflvault) |
| 108 | - run ./genymotion: UI should be streamed to your computer |