How to compile PJSIP for Android? - android

I'm trying to compile PJSIP for Android. I follow official tutorial from this site: https://trac.pjsip.org/repos/wiki/Getting-Started/Android.
Unfortunately when I execute command "make dep" I get this error:
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f Samples.mak dependmake[2]: Nothing to be done for `depend'.
My steps:
- I cloned repo from svn. Also tried release package.
- I added config_site.h. Exactly the same as in tutorial.
- Android NDK export is defined in bash_profile.
- Execution of ./configure-android goes without any problems.
I'm using MacOS for building. I also tried on Ubuntu but I get the same error...
In MacOS I also have SWIG installed throught brew package manager.
Any ideas why I get this error?
Thanks in advance for any help.

Ok, I found out how to make it work. You have to modify Makefile in (project_root)/pjsip-apps/build and move line:
$(MAKE) -f Samples.mak $#
to saparate section without "depend":
clean realclean:
$(MAKE) -f Samples.mak $#

Related

How to compile Boost 1.61 for Android NDK 11

I want to install compile Boost 1.61 with clang 3.6 for android with the NDK 11 but this software : https://github.com/moritz-wundke/Boost-for-Android isn't updated and doesn't support this versions.
I want to know if anyone has managed to this !
Thank you !
Build boost_1_62_0 for Android-21 under Windows64.
Assuming NDK installed to C:\Programs\Android\sdk\ndk-bundle and boost in c:\boost_1_62_0.
Install mingw: using msys2-x86_64 from MSYS2
Install build tools from mingw prompt (something like this):
$ pacman -S gcc binutils
Create android.clang.jam file in C:\boost_1_62_0\ with such text content:
import os ;
local AndroidNDKRoot = C:/Programs/Android/sdk/ndk-bundle ;
using clang : android
:
C:/Programs/Android/toolchain21/bin/clang++
:
<compileflags>-fexceptions
<compileflags>-frtti
<compileflags>-fpic
<compileflags>-ffunction-sections
<compileflags>-funwind-tables
<compileflags>-Wno-psabi
<compileflags>-march=armv7-a
<compileflags>-mfloat-abi=softfp
<compileflags>-mfpu=vfpv3-d16
<compileflags>-fomit-frame-pointer
<compileflags>-fno-strict-aliasing
<compileflags>-finline-limit=64
<compileflags>-I$(AndroidNDKRoot)/platforms/android-21/arch-arm/usr/include
<compileflags>-Wa,--noexecstack
<compileflags>-DANDROID
<compileflags>-D__ANDROID__
<compileflags>-DNDEBUG
<compileflags>-O2
#<compileflags>-g
<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.9/include
<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include
<architecture>arm
<compileflags>-fvisibility=hidden
<compileflags>-fvisibility-inlines-hidden
<compileflags>-fdata-sections
<cxxflags>-D__arm__
<cxxflags>-D_REENTRANT
<cxxflags>-D_GLIBCXX__PTHREADS
;
Setup boost from mingw prompt:
$ export NDK=/c/Programs/Android/sdk/ndk-bundle
$ echo ensure msi-installed Python is on path (not msys version):
$ export PATH=/c/Python27:$PATH
$ $NDK/build/tools/make_standalone_toolchain.py --arch arm --api 21 --install-dir /c/Programs/Android/toolchain21
$ ./bootstrap.sh --with-toolset=gcc
$ ./b2 --user-config=android.clang.jam threading=multi link=static \
runtime-link=static toolset=clang-android target-os=linux \
threadapi=pthread --stagedir=android --with-chrono \
--with-program_options --with-system --with-thread --with-random \
--with-regex
Yes, the repository you mentioned is apparently not maintained anymore. The author also seems not to answer any mails on the subject. If you look you'll see that each new boost version supported there required a lot of work (many special flags in the config files). That's presumably why he doesn't have time to maintain it any longer.
I also tried to update to 1.64 using a fork but gave up after countless error messages and instead used a different method based on a crystax script. Its simple and should work for pretty much any version. You can find the details and the script (simple and painless to execute) here: http://silverglint.com/boost-for-android/
Works with clang and gcc.
Also included is a sample app that shows you how to use the boost binaries thus built.

Javah class access fail

I wanna use tesseract library with my application so i need to implement ndk.i download it add its path to my bash_profile.
export ANDROID_ADB=/Users/gokhanaliccii/Library/Android/sdk/platform-tools
export ANDROID_NDK=/android_ndk/android-ndk-r10d
export PATH=$PATH:$ANDROID_ADB:$ANDROID_NDK
My problem is appeared when i run -javah command at studio terminal. My command is
javah -d jni -classpath /Users/gokhanaliccii/Library/Android/sdk/platforms/android-19/android.jar:/Users/gokhanaliccii/Documents/gokhan_private/android_ocr/NDK_TEST/app/build/intermediates/classes/debug gokhanaliccii.kou.ndk_test.MainActivity
after i got this error i tried to add support libraries
I tried to solved it but i coulndt find solution i'm really exhausted i hope someone know how to solve it
My project is at /Users/gokhanaliccii/Documents/gokhan_private/android_ocr/NDK_TEST
Dont need cp for javah
Run javac on source that includes file with native headers.
Cd to path that is parent of the root of where the ".class" files are.
On cli or in terminal run the javah ( no cp needed )
If stuvk do the ndk samples and it will make sense . They walk u thru javah sample
After lot of researches and training i solved my problem.
javah -classpath /Users/gokhanaliccii/Library/Android/sdk/platforms/android-19/android.jar:/Users/gokhanaliccii/Library/Android/sdk/extras/android/support/v7/appcompat/libs/android-support-v4.jar:/Users/gokhanaliccii/Library/Android/sdk/extras/android/support/v7/appcompat/libs/android-support-v7-appcompat.jar:../../build/intermediates/classes/debug -d jni gokhanaliccii.kou.ndk_test.MainActivit
My result command is above.I tried it at android studio,classes files are at build/intermediadtes/classes/debug if you want try it at eclipse it is under bin folder.

Building webrtc library

I am trying to build webrtc android demo application. I was following README applied by the project. First thing was mentioned about gclient but when i tried to run it "no external or internal command". Then i got this link according to the this link i cloned the depot_tool repository but when at the step when i try to run gclient i got this
So after hours of trying i am not able to run it. if any one has experience with this WebRTC library please provide some help. Any guidance? Any Hlep will be appreciated
I heard few things were changed from svn to GIT. We tried building webRTC to windows7 using visual studio. See if you can use any parts on this.
Get depot_tools software and extract to a location (set this path in environment variable).
cd to depot_tools directory and hit 'gclient' (this should take sometime)
Install python 2.7 and put it path.
create a folder of your choice for webRTC and open command prompt there.
Now hit, gclient config http://webrtc.googlecode.com/svn/trunk
then, gclient sync.
Then set GYP_GENERATORS=msvs environment variable (use ninja if you want that).
Also set msvs_version=2012 (depending on your visual studio version)
now run, gclient runhooks --force
This should generate solutions files for your folder. fireup the libjingle/webrtc.sln files and start building it. I'm not sure if it builds as is. But we had hicupps with that.
See this link on WebRTC native development if you haven't already. From my personal experience building this tricky job initially.
Also note that links might be deprecated as they moved to git, don't know if they are still maintaining it.
How to compile WEBRTC On ubuntu
download script and run:
https://cs.chromium.org/chromium/src/build/install-build-deps.sh
./build/install-build-deps.sh --no-chromeos-fonts
Now download depot tools
$ git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
Put it in Path
$ export PATH=`pwd`/depot_tools:"$PATH"
Define your settings:
export GYP_DEFINES="target_arch=x64 host_arch=x64 build_with_chromium=0 use_openssl=0 use_gtk=0 use_x11=0 include_examples=0 include_tests=1 fastbuild=1 remove_webcore_debug_symbols=1 include_pulse_audio=0 include_internal_video_render=0 clang=1 "
make file to download the source
mkdir webrtc-checkout
cd webrtc-checkout
I chose branch 50 you can change it
gclient config https://chromium.googlesource.com/external/webrtc.git#branch-heads/50 --name=src
gclient sync --force --with_branch_heads
gclient sync --force --with_branch_heads --nohooks
cd src
git checkout branch-heads/50
gclient runhooks
ninja -C ./out/Release
Collect your LIB & Include file to use it in your project
mkdir ../lib/
find ./ -name "*.o" -and -not -name do_not_use -and -not -name protoc -and -not -name genperf -exec ar crs ../lib/libwebrtc.a {} +
mkdir ../include
find ./ -name *.h -exec cp --parents '{}' ../include ';'

"cordova platform add android" fails with unexpected error

i am trying to install Phonegap on Ubuntu 13.04, i have installed the Android SDK with all available Packages, but running the following command:
cordova platform add android
fails with an unexpected error:
[Error: An error occured during creation of android sub-project. An unexpected error occurred: "$ANDROID_BIN" create project --target $TARGET --path "$PROJECT_PATH" --package $PACKAGE --activity $ACTIVITY &>/dev/null exited with 1
Deleting project...
I have set the PATH Variables for Android (tools / platform-tools) and java and ant are installed.
Why does this happen? How can i get a more detailed error message?
have you tried running command with sudo?
it could be a permissions issue.
If still not working, try running it using verbose mode i.e. sudo -d cordova...
In case this is due to activity name whitespaces, see comments for this answer.
There is an issue reported in https://issues.apache.org/jira/browse/CB-4198, for which I've sent a pull request to remove whitespaces https://github.com/phonegap/phonegap/pull/39.
As #José said, the "hello" example doesn't work because spaces are not allowed.
Changing it to "HelloWorld" solves the problem.
remove the space in between name tags in config.xml
MyAppName< name>
In my case, using debian wheezy, the example from: http://docs.phonegap.com/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface does not work with this error:
[Error: An error occured during creation of android sub-project. An unexpected error occurred: "$ANDROID_BIN" create project --target $TARGET --path "$PROJECT_PATH" --package $PACKAGE --activity $ACTIVITY &>/dev/null exited with 1
Deleting project...
]
After adding $JAVA_HOME (Java sun, with openjdk did't work) and $PATH the andriod sdk path to .../sdk/platform-tools:../sdk/tool
The solution in my case was the project name:
The example that doesn't work:
cordova create HelloWorld com.example.hello "Hello World"
THIS works:
cordova create HelloWorld com.example.hello HelloWorld
Make sure your package and project names are correct, following the com.mycompanyname.myappname format without any numbers or dashes.
Here's the issue being tracked by PhoneGap.
If you open up the create file (phonegap-2.7.0/lib/android/bin/create) with textEdit, there is a line that lists
ANDROID_BIN=”${ANDROID_BIN:=$( which android )}”.
The “which android” is the cause of the issue
If you replace this line with the full path to your android tools (SDK), it should resolve the issue. It looked like this:
ANDROID_BIN=/Users/cswjs/Documents/Dev/adt-bundle/sdk/tools/android
OR try modify ~/.bash_profile using open ~/.bash_profile to full PATH
export PATH=${PATH}:/Users/cswjs/Documents/Dev/adt-bundle/sdk/platform-tools:/Users/cswjs/Documents/Dev/adt-bundle/sdk/tools
And use cordova create foo com.example.foo foo to create new project named foo. Make sure project name should be same.
Hope this could help someone!
IN my case there are many places in create script where u need to remove >null to see real logs. and i finally resolved my issues by
sudo chown -R sachinsharma ~/.cordova

Cross-compiling librtmp for android

Has anybody out there successfully cross-compiled librtmp for the Android platform? I know that the rtmpdump android download has librtmp.so included, but I think I need librtmp.a also (I am trying to cross-compile ffmpeg with librtmp support).
Anybody had any luck with this? It's driving me bonkers....
Ta
Dan
have a look here http://stream-recorder.com/forum/rtmpdump-build-android-t13466.html
and I've put a howto on my github here https://github.com/S74ck3r/rtmpdump/blob/master/readme-howto-build.txt
hope that helps
Richard
I* just successfully built librtmp for Android using the Guardian Project's OpenSSL repo. I documented my steps here along with preserved build scripts.
In a nutshell, build OpenSSL per GuardianProject's directions, then run the following script in rtmpdump/librtmp:
#build_librtmp_for_android.sh
NDK=/path/to/android-ndk-r9c
SYSROOT=$NDK/platforms/android-19/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64
OPENSSL_DIR=/path/to/openssl-android/
# Note: Change the above variables for your system. Also ensure you've built openssl-android
function build_one
{
set -e
make clean
ln -s ${SYSROOT}usr/lib/crtbegin_so.o
ln -s ${SYSROOT}usr/lib/crtend_so.o
export XLDFLAGS="$ADDI_LDFLAGS -L${OPENSSL_DIR}libs/armeabi -L${SYSROOT}usr/lib "
export CROSS_COMPILE=$TOOLCHAIN/bin/arm-linux-androideabi-
export XCFLAGS="${ADDI_CFLAGS} -I${OPENSSL_DIR}include -isysroot ${SYSROOT}"
export INC="-I${SYSROOT}"
make prefix=\"${PREFIX}\" OPT= install
}
CPU=arm
PREFIX=$(pwd)/android/$CPU
ADDI_CFLAGS="-marm"
build_one
*with the incredible help of my pal Chris.

Categories

Resources