blob: 56b54774e56caee7a241db77a7b094b18227bda3 [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 Lision08494102014-01-24 15:17:04 -050028$ 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
alisionf4571d92013-07-04 17:11:35 -040029
alisionf76de3b2013-04-16 15:35:22 -040030$ make dep && make
31$ popd
32
33
34Generate dbus interface
Alexandre Lision7c6f4a62013-09-05 13:27:01 -040035$ ./make-swig.sh
36
37Compile libsndfile-1.0.25
38$ pushd jni/libsndfile-1.0.25/
39$ ./configure --disable-alsa --disable-external-libs
40$ popd
alisionf76de3b2013-04-16 15:35:22 -040041
Adrien Béraud432f0672013-02-27 17:06:36 -050042
Alexandre Lision08494102014-01-24 15:17:04 -050043$ ndk-build APP_ABI=armeabi-v7a -j4
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
67 - Offers 10+ different devices
68
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 Lision08494102014-01-24 15:17:04 -050073 Android provides an option APP_ABI, defining for which arch it is built (it can be more than one at the same time)
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
77 $ 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
78
79 And don't forget to rebuild the rest of the JNI project with:
80 $ ndk-build APP_ABI=INSERT_ARCH_HERE -j4
81
Alexandre Lision0fbcc4e2014-01-22 13:02:28 -050082
83Notes:
84
85 - Using SFLphone on VMs:
86 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.
87
88 To solve that problem, you need to change VirtualBox settings of the Android VMs.
89 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.
90
91 In the network panel, leave the first Adapter as it is (Host-only, vboxnet0).
92 In the second adapter tab, switch NAT, to Bridged Adapter.
93
94 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 -050095
96