blob: 5d515c3329e7c616bdb0a86919af146987ea4fbf [file] [log] [blame]
sfl android42fcf7a2012-08-06 15:45:32 -04001This repository is meant for the porting of SFLphone to Android.
2
3
4To build SFLphone and all its dependencies, make sure that Android's NDK and SDK
5are properly installed on your system.
6
7You have also to make sure that the following environment variables are defined:
8
Tristan Matthewsd8aa4322013-07-17 10:51:54 -04009export ANDROID_NDK=$HOME/path/to/android-ndk-r*b
10export ANDROID_SDK=$HOME/path/to/android-sdk-linux
sfl android42fcf7a2012-08-06 15:45:32 -040011
12The path to the required Android's build executable must be also specified:
13
14export PATH=$PATH:$ANDROID_NDK
Emeric Vigier9701e032012-09-12 12:38:01 -040015
16BUILD
17-----
Emeric Vigiercca7f562012-09-20 14:22:30 -040018install swig-2.0.6 or later and python-2.7 or later on your system
Emeric Vigier9701e032012-09-12 12:38:01 -040019
20$ cd sflphone-android
21
22Check that following files are executable:
23 jni/sflphone/daemon/src/JavaJNI2CJNI_Load.py
24 make-swig.sh
25
Adrien Béraud432f0672013-02-27 17:06:36 -050026Compile pjsip-android
Alexandre Lision7c6f4a62013-09-05 13:27:01 -040027$ pushd jni/pjproject-android/
Alexandre Lision39ec4cd2014-01-27 13:51:33 -050028$ make realclean
Alexandre Lision08494102014-01-24 15:17:04 -050029$ 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
alisionf76de3b2013-04-16 15:35:22 -040030$ make dep && make
31$ popd
32
Adrien Béraud5c12b3b2014-01-28 10:56:03 -050033Configure deamon for Android
Adrien Béraudc232fdb2014-01-28 11:12:07 -050034$ pushd jni/sflphone/daemon/
35$ ./configure-android.sh
Adrien Béraud5c12b3b2014-01-28 10:56:03 -050036$ popd
alisionf76de3b2013-04-16 15:35:22 -040037
38Generate dbus interface
Alexandre Lision7c6f4a62013-09-05 13:27:01 -040039$ ./make-swig.sh
40
Adrien Béraudc232fdb2014-01-28 11:12:07 -050041$ pushd jni/
Alexandre Lision08494102014-01-24 15:17:04 -050042$ ndk-build APP_ABI=armeabi-v7a -j4
Adrien Béraudc232fdb2014-01-28 11:12:07 -050043$ popd
Emeric Vigier9701e032012-09-12 12:38:01 -040044
Emeric Vigierc30b71d2012-09-12 14:51:47 -040045Check that no errors occurred. In particular, following files should have been generated by make-swig.sh:
Emeric Vigier9701e032012-09-12 12:38:01 -040046 sflphoneservice_loader.c
47 callmanager_wrap.cpp
48 sflphoneservice.java
49 sflphoneserviceJNI.java
50 ManagerImpl.java
51
alisionf76de3b2013-04-16 15:35:22 -040052
Alexandre Lision0fbcc4e2014-01-22 13:02:28 -050053Then build android project with your favorite JDK: eclipse, intellijidea or ant.
54
55
56
57************************** GENYMOTION HOW TO *************************
58
59Genymotion is an open source project to run Android VMs with standard images (Nexus, 4, 7, 10, Xperia etc.) on top of VirtualBox.
60
61www.genymotion.com/
62
63Pros:
64 - Very fast
65 - Integrated to IDEs (tested with IntellijIDEA)
66 - Can be integrated in jenkins as well
Alexandre Lision39ec4cd2014-01-27 13:51:33 -050067 - Offers 20+ different devices
Alexandre Lision0fbcc4e2014-01-22 13:02:28 -050068
69Cons:
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 Lision85382382014-01-27 15:54:16 -050073 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 Lision08494102014-01-24 15:17:04 -050074
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 Lision85382382014-01-27 15:54:16 -050077 $ make realclean
Alexandre Lision08494102014-01-24 15:17:04 -050078 $ 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 Lision39ec4cd2014-01-27 13:51:33 -050081 $ ndk-build APP_ABI=INSERT_ARCH_HERE -j4
Alexandre Lision08494102014-01-24 15:17:04 -050082
Alexandre Lision0fbcc4e2014-01-22 13:02:28 -050083
84Notes:
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 Lision08494102014-01-24 15:17:04 -050096
97
Alexandre Lision39ec4cd2014-01-27 13:51:33 -050098
99************************** JENKINS HOW TO *************************
100
101
102SFLphone android uses jenkins to run tests on genymotions emulators.
103
104To 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