I used Linux operating system to start working on Linphone Android. So, I will share all things to start working on Linphone step by step.
1. Install Linux/Ubutu 32 or 64 bit operating system.
Go to Ubuntu site to download: Ubuntu
2. Install Java.
Open “ubuntu software center” and search “java” and than install “Open JDK Java Runtime”.
3. Install Eclipse.
Open “ubuntu software center” and search “eclipse” and than install “Eclipse”.
4. Download Android SDK.
Go to android developer site: Android SDK and scroll down and then download .tgz extension file.
5. Install Android SDK Packages.
Go to android-sdk-linux folder than tools folder than copy the path till tools folder. For example:-
/home/znsoftech/Desktop/android/android-sdk-linux/tools
Now open terminal by using CTRL+ALT+T command or by searching: press super key(window key) than search “terminal” than open it.
Now type on terminal
$ cd /home/znsoftech/Desktop/android/android-sdk-linux/tools
press enter and than type
$ ./android
press enter and than select latest android API, tools and libraries according to your requirement.
6. Download Android NDK.
Go to android developer site: Android NDK and than download android ndk(in .bin format) according to your system(32/64 bit). After completing download, go to download directory(folder) in terminal and than execute following commands:
$ chmod a+x android-ndk-r10c-darwin-x86_64.bin
$ ./android-ndk-r10c-darwin-x86_64.bin
7. Edit .bashrc file
Open new terminal and type
$ ~/.bashrc
than add tools, platform tools, android ndk path and emulator command(If you are using 32 bit operating system) to bashrc file
export PATH=${PATH}:/home/znsoftech/Desktop/android/android-sdk-linux/tools
export PATH=${PATH}:/home/znsoftech/Desktop/android/android-sdk-linux/platform-tools
export PATH=${PATH}:/home/znsoftech/Desktop/android/android-ndk-r10d
export ANDROID_EMULATOR_FORCE_32BIT=true
8. Setting up an Android Virtual Device.
Open terminal and type:
$ android avd
hit enter and add a device to launch emulator. Add DNS server setting options, read here: Warning no dns servers found
9. Install ADT plugin on Eclipse.
Open Eclipse than go to Help option and than select “Install new Software...” option. Click on Add button and than type following things:
Name : ADT Plugin
Location : https://dl-ssl.google.com/android/eclipse/
Click on OK button and wait..than select “Developer Tools” check box and than next->next->accept license->OK
After restarting eclipse, add sdk and ndk location in eclipse(Window -> Preferences).
Till now, all android project environment is set. Now, we need to install sum more libraries for Linphone android project.
10. Install Libraries and Tools for Linphone.
run all commands on terminal one by one.
$ sudo apt-get install yasm
$ sudo apt-get install nasm
$ sudo apt-get install curl
$ sudo apt-get install ant
$ sudo apt-get install rsync
$ sudo apt-get install autoconf
$ sudo apt-get install automake
$ sudo apt-get install aclocal
$ sudo apt-get install libtoolize
$ sudo apt-get install pkgconfig
If your system is 64 bit than excute following command as well:-
$ sudo dpkg --add-architecture i386
$ sudo apt-get install aptitude
$ sudo aptitude update
$ sudo aptitude install libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386
11. Download git repository of Linphone android.
Run the following command to install git and Linphone android project from github site.
$ sudo apt-get install git
$ sudo git clone git://git.linphone.org/linphone-android.git --recursive
12. Run Makefile Script.
Open terminal and go to linphone android directory.
$ cd linphone-android
now run the Makefile script in the top level directory. This will download iLBC source files and convert some assembly files in VP8 project.
$ make
13. Import Linphone Android Project to Eclipse.
Open Eclipse and selcet File -> Import... -> Android -> Existing Android code into Workspace -> Browse... and than select linphone-android folder(Only select linphone-android and don't tick on “copy projects into workspace” ) than OK.
Now everything is
set. Start working to customize Linphone android project. For programming part, check this: Android Linphone source code tutorial - Part 2
Related Programs:-
★ In Android app Screen-shots and ListView tricks
★ Extract APK File into Source Code (Java code and XML code)
★ Add Google AdMob Ads in Android App & Earn Money
★ Add Facebook SDK in Android Application
★ Advance Android Google Map 2 Tutorial with Examples - Part 1
Hi. Thanks for your tutorial! I was able to follow up till step 8. When I entered android avd, it says command not found. I did opened up a new terminal... Do I need to cd to anywhere else? Any ideas to resolve this? Please help me! Thanks!!
ReplyDeleteNo need to change directory. Check given link on step 8 as well.
Deletemoshin can we talk i am facing some issue compiling linphone..
Deletei have installed cmake and ndk-build but it alwas says they are missing waiting for your reply
Thanks Moshin well done !
ReplyDeleteYou set the target build Android 5.1,what will be the minimum SDK?
The NDK version is revision 10d I used instead 10e and crash at runtime.
Do you recommend de r10e?
hey i need help
ReplyDeleteThanks for your tutorial!
ReplyDeletebut i got some problem here.. I can't install aclocal or libtoolize or pkgconfig on ubuntu 14.04.. can you explain how to do that?
Thanks in advanced!
If you are using 32-bit pc than no need to install these packages.
Deletethanks for your reply.. and I got another problem here.
DeleteI can't complete step 12. Here's my command line
--------------------------------------------------------------
com08@ubuntu:~/linphone-android$ make
touch: cannot touch ‘check_tools.mk’: Permission denied
./check_tools.sh: 45: ./check_tools.sh: cannot create check_tools.mk: Permission denied
./check_tools.sh: 46: ./check_tools.sh: cannot create check_tools.mk: Permission denied
Makefile:80: check_tools.mk: No such file or directory
make: *** No rule to make target `check_tools.mk'. Stop.
------------------------------------------------------------
and when I run with sudo make
--------------------------------------------------------------
com08@ubuntu:~/linphone-android$ sudo make
Could not find ndk-build. Please install android NDK.
Could not find android. Please install android SDK.
Makefile:73: *** commands commence before first target. Stop.
------------------------------------------------------------------
how can i fix that?
looking forward to hearing from you soon..:)
vim check_tools.sh
Deletethen type"set fileformat",check if fileformat=dos,if so,then type "set fileformat=unix",then save and quit
hi @Md Mohsin, @Sand Zheng,
Deletethanks for helping me.
up to now I can build it and make some files: check_tools.mk, rootca.pem.. but i still got some errors for several days, here they are:
------------------------------------------------------------
jni/..//submodules/linphone/build/android/../../coreapi/bellesip_sal/sal_op_message.c:135: error: undefined reference to 'xmlParseDoc'
jni/..//submodules/linphone/build/android/../../coreapi/bellesip_sal/sal_op_message.c:291: error: undefined reference to 'xmlParseDoc'
...........................
jni/..//submodules/externals/build/libxml2/../../libxml2/tree.c:396: error: undefined reference to 'xmlStringCurrentChar'
jni/..//submodules/externals/build/libxml2/../../libxml2/tree.c:400: error: undefined reference to 'xmlStringCurrentChar'
...........................
------------------------------------------------------------
Do you have any ideas? I've already installed libxml2.. but i still got that error.. I use ubuntu 14.04 LTS.. Do I need to change or do something with this OS?
I found that I don't have xmlParseDoc, xmlReadDoc, xmlReadFile.. where can i get these files? I thought that when I installed the libxml2, these files could be downloaded automatically.. but they didn't.. how do I do it?
DeleteChâu Vũ I am having the same problem as you had. Whenever i try to make or sudo make it gives the same errors as you mentioned above. Please help me how you solved it
Deleteyou can check my answer here.. :).. http://stackoverflow.com/questions/31151978/linphone-error-when-build-undefined-reference
Delete-----------------------------
or you can scroll down and read my comment. :). hope it'll help you..
hey Châu Vũ i have the same problem
ReplyDeleteCould not find ndk-build. Please install android NDK.
Could not find android. Please install android SDK.
Makefile:73: *** commands commence before first target. Stop.
do you find a solution ?
do you export path in bashrc file? if not you can edit it with gedit. Bashrc file in /home/yourUserName/..
Delete-------------------------------------------------------------
or you can follow these steps.. I can build linphone by them:
use ndk r10c
use source: https://github.com/BelledonneCommunications/linphone-android
clean project: git clean -xfd
update submodule: git submodule update --init --recursive
ndk-build TARGET_PLATFORM=android-x (x is your current API)
run $make
------------------------------------------------------
you should try the first one.. good luck..:)
im really noob to export path tell me if thats right please
Deleteexport PATH=${PATH}:/home/hitech/Téléchargements/android-sdk-linux/tools
export PATH=${PATH}:/home/hitech/Téléchargements/android-sdk-linux/platform-tools
export PATH=${PATH}:/home/hitech/Téléchargements/android-ndk-r10c
for the second i don t know what to do from
Deleteclean project: git clean -xfd
update submodule: git submodule update --init --recursive
ndk-build TARGET_PLATFORM=android-x (x is your current API)
and thank you for help
-- Your folder "Téléchargements", I think because of this.. you should not use this, you should put it in a folder like "a" or "b" or just extract sdk and ndk in /home/hitech/yourSDK and the same with NDK.
Delete-- the commands I gave you, you run in the linphone-android folder. You should use source I gave you because that's the official code. :). They have some update.. If you don't use you may get some errors when build, because of the android M..:).. you can read the update in the second column.
thank's for your help it works now you are great guy's
Deleteyou reskin the app ?
:d.. you're welcome.. I just like to make an app like that..
DeleteThis comment has been removed by the author.
DeleteThe enviroment path is not working with "sudo make" command. You should try:
Delete$ sudo chmod 777 linphone-adnroid
$ cd linphone-android
$ make
This comment has been removed by the author.
ReplyDeleteI am getting this error while running make command. and i cant find any solution.
ReplyDeleteBUILD FAILED
/opt/android-sdk-linux/tools/ant/build.xml:720: The following error occurred while executing this line:
/opt/android-sdk-linux/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.
Total time: 6 seconds
make: *** [javah] Error 1
I fixed this issue turns out SDK wasn’t updated to the API 22.
DeleteAnd i had error after this too but most of the issues came in 64bit Ubuntu I could not find solution for. But the compilation worked in 32bit Ubuntu error free.
ndk-build TARGET_PLATFORM=android-x (x is your current API)
Deletedo you try this? run in your linphone-folder
I am trying to working with windows OS. Can you guide me how to do that ? I have almost no experience of building or developing application of android ndk. I just print hello world today using ndk.
ReplyDeleteUse Linux/Mac OS.
DeleteWhile executing make from linphone-android, i am getting non_versioned_soname_patch_applied.txt failed.
ReplyDeleteBut i could not find non_versioned_soname_patch_applied.txt from linphone-android/submodules/externals/ffmpeg/ in the linphone-android source code.
sudo git clone git://git.linphone.org/linphone-android.git --recursive
DeletePlease can you do a similar tutorial but this time for windows based users!!
ReplyDeleteI managed to fix the sdk location error, but it still persists that my ndk is not installed.. which js and paths set right.. should i install 10c instead of NDK?
ReplyDeleteNever mind, fixed. Refer here if having same issues like me...
Deletehttp://stackoverflow.com/questions/33819001/linphone-make-error-could-not-find-ndk-build-could-not-find-android/33838107#33838107
when I do a make command, I got an error Missing some git submodules. Did you run 'git submodule update --init --recursive'?
ReplyDeletePlease help..:(
sudo git clone git://git.linphone.org/linphone-android.git –recursive
DeleteIt should be "--recursive", not "-recursive" So just copying the link wont give correct link, change it to --
you are correct Sir. This happened due to copy-paste.
Deletedoes linphone compile and build in windows machine...?
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteAuthor, your instructions are incomplete. You should ask to read inner README file, as instructions given by you aren't enough. You can remove this comment as well. Or, if you will be kind enough, would you answer my question?
ReplyDeleteWhat can I do if I get:
CMake Error at toolchains/android/toolchain-android.cmake:76 (message):
Cannot find libgcc.a
Thank you a lot.
When I was doing this project I have used above instructions. Now there are some changes in new Readme file. This error comes due to c++ compiler but I am not sure.
Deletehi. which version of ubuntu did you use?
ReplyDeleteHi, I wrote this article previous year so I forgot now. May be Ubuntu 14.0
Delete(question for mohsin)
ReplyDeletei need use this dependence ,but he gives me this error
ReplyDeleteError:A problem occurred configuring root project 'linphone-android'.
> Could not resolve all dependencies for configuration ':_debugCompile'.
> Could not find io.socket:socket.io-client:0.7.0.
Searched in the following locations:
file:/Applications/Android Studio.app/Contents/gradle/m2repository/io/socket/socket.io-client/0.7.0/socket.io-client-0.7.0.pom
file:/Applications/Android Studio.app/Contents/gradle/m2repository/io/socket/socket.io-client/0.7.0/socket.io-client-0.7.0.jar
file:/Users/Angel/Library/Android/sdk/extras/android/m2repository/io/socket/socket.io-client/0.7.0/socket.io-client-0.7.0.pom
file:/Users/Angel/Library/Android/sdk/extras/android/m2repository/io/socket/socket.io-client/0.7.0/socket.io-client-0.7.0.jar
file:/Users/Angel/Library/Android/sdk/extras/google/m2repository/io/socket/socket.io-client/0.7.0/socket.io-client-0.7.0.pom
file:/Users/Angel/Library/Android/sdk/extras/google/m2repository/io/socket/socket.io-client/0.7.0/socket.io-client-0.7.0.jar
Required by:
:linphone-android:unspecified
Thanks for the write up, very helpful for a newbie like me...
ReplyDeleteMost of this is still valid but anyone having issues should read the README file in linphone-android folder.
Before step 12 "$ make", the only additional steps needed were:
$ sudo chown -R $USER ~/linphone-android/
$ cd ~/linphone-android
$ ./prepare.py
$ make
Linphone compiled successfully using Ubuntu amd64 16.04.1, SDK API 24, NDK r12b.
Hi...
ReplyDeleteHow can we send Vcard from one chat room to another in linphone android?
Hello,
ReplyDeleteI am in desperate need of the linphone android source code. Please if you can send me at chandan.kumar@mobimonster2.com
THANK YOU!
Hello,
ReplyDeletethanks a lot for your tutoria.
But yust one question...
the NDK to use should be android-ndk-r10e-linux-x86_64.zip ?
why you used MAC version?
android-ndk-r10c-darwin-x86_64.bin
Regads
Mirko
This comment has been removed by the author.
ReplyDeleteA problem occurred configuring root project 'linphone-android'.
ReplyDelete> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:3.3.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.3.
> java.lang.NoClassDefFoundError: Could not initialize class sun.security.ssl.SSLContextImpl$TLSContext
> Could not resolve com.android.tools.build:gradle:3.3.
> java.lang.NoClassDefFoundError: Could not initialize class sun.security.ssl.SSLContextImpl$TLSContext
[ 1%] Building C object library/CMakeFiles/mbedcrypto.dir/aes.c.o
ReplyDelete/bin/sh: 1: ccache: not found
library/CMakeFiles/mbedcrypto.dir/build.make:62: recipe for target 'library/CMakeFiles/mbedcrypto.dir/aes.c.o' failed
make[6]: *** [library/CMakeFiles/mbedcrypto.dir/aes.c.o] Error 127
make[6]: Leaving directory '/media/asus/WORK/Linux/linphone-android/WORK/android-arm64/Build/mbedtls'
CMakeFiles/Makefile2:122: recipe for target 'library/CMakeFiles/mbedcrypto.dir/all' failed
make[5]: *** [library/CMakeFiles/mbedcrypto.dir/all] Error 2
make[5]: Leaving directory '/media/asus/WORK/Linux/linphone-android/WORK/android-arm64/Build/mbedtls'
Makefile:129: recipe for target 'all' failed
make[4]: *** [all] Error 2
make[4]: Leaving directory '/media/asus/WORK/Linux/linphone-android/WORK/android-arm64/Build/mbedtls'
CMakeFiles/EP_mbedtls.dir/build.make:112: recipe for target '/media/asus/WORK/Linux/linphone-android/WORK/android-arm64/Stamp/EP_mbedtls/EP_mbedtls-build' failed
make[3]: *** [/media/asus/WORK/Linux/linphone-android/WORK/android-arm64/Stamp/EP_mbedtls/EP_mbedtls-build] Error 2
make[3]: Leaving directory '/media/asus/WORK/Linux/linphone-android/WORK/android-arm64/cmake'
CMakeFiles/Makefile2:641: recipe for target 'CMakeFiles/EP_mbedtls.dir/all' failed
make[2]: *** [CMakeFiles/EP_mbedtls.dir/all] Error 2
make[2]: Leaving directory '/media/asus/WORK/Linux/linphone-android/WORK/android-arm64/cmake'
Makefile:83: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/media/asus/WORK/Linux/linphone-android/WORK/android-arm64/cmake'
Makefile:176: recipe for target 'arm64-build' failed
make: *** [arm64-build] Error 2
getting this error kindly help to fix this ?
same error here
Deletei got following problem
ReplyDelete* What went wrong:
A problem occurred evaluating root project 'linphone-android'.
> A problem occurred starting process 'command '/home/kashif/Android/Sdk/platform-tools/adb''
Hi!
ReplyDeletei run the linphone sample project but i don't know how i can register with them... how the calling works... could you please help?
Hi..
ReplyDeleteI am using the linphone jar file for making audio as well as Video call.
Audio call is working fine but when i try to make video call using the linphone jar, is not supporting..
The api linphonecore.isVideosupported() is always returning false.
Can any one please help me..
Please it is the Liblinphone lib? I am really struggling to even logging to my sip server can you help share registration code removing any sensitive data
DeleteI have imported linphone-android as Android studio project after make.
ReplyDeletewhen I am launching application my application stops before any screen appears. when I debug I saw that application crashes on this line inside LinphoneMangaer.java file: mLc = Factory.instance().createCore(mConfigFile, mLinphoneFactoryConfigFile, c);
if you upload the build version of this, it will help us, cause the steps are just too complex...please upload the built version, and will can run it on our devices thanks
ReplyDeletetry to run the $make but get this error:
ReplyDeletemake: *** No rule to make target 'clean'. Stop.
how can i solve that problem?
is it work on windows10
ReplyDeletei hav linphone android open source code i need to connect app calls to my own sip address ,.. please anyone help
ReplyDelete