I am using ijkplayer in my android app that I compile using
compile 'tv.danmaku.ijk.media:ijkplayer-java:0.4.5'
compile 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.4.5'
It works perfectly loading http urls but if I try to load https urls I get this error
https protocol not found, recompile FFmpeg with openssl, gnutls, or securetransport enabled.
and can't load my video. I don't know if it makes any difference but the url I am trying to load is a .m3u8 but if it is http works fine.
How can I recompile ffmpeg in this lib?
Hi Petro i am not proffesional but hope this tutorial would help.
You have to compile ijkplayer with openssl support to open https links,
to do that follow this steps:
Grab latest version of IjkPlayer from github:
$ git clone https://github.com/Bilibili/ijkplayer.git
Open just downloaded folder ijkplayer
Remove symlinks to module.sh and create symlink to module-lite.sh
$ cd config
$ rm module.sh
$ ln -s module-lite.sh module.sh
Do initialisation of OpenSSL (getting ready to download and compile openssl first)
$ cd ..
$ ./init-android-openssl.sh
Make sure you have pointed for your SDK and NDK path.
(NDK r10e preffered - I am not sure if SDK is needed but just in case i did exported it)
NOTE: make sure you have changed your path properly that is only example of path what i have used.
export ANDROID_SDK="/home/ZiomusGorliczanin/SDK"
export ANDROID_NDK="/home/ZiomusGorliczanin/NDK"
Open IjkPlayer/android/contrib folder and fire up compile-openssl.sh clean and all command (that will compile openssl for all processors).
$ cd android/contrib
$ ./compile-openssl.sh clean
$ ./compile-openssl.sh all
Compilation might take a while 10 min.
Compile FFMpeg with OPENSSL for all processors:
$ cd android/contrib
$ ./compile-ffmpeg.sh clean
$ ./compile-ffmpeg.sh all
Finally compile IjkPlayer with all above as a liblary.
$ cd ..
$ ./compile-ijk.sh all
After all this steps you should have liblaries in those folders (Three *.so files):
ijkplayer/ijkplayer-armv5/src/main/libs
ijkplayer/ijkplayer-armv7a/src/main/libs
ijkplayer/ijkplayer-arm64/src/main/libs
ijkplayer/ijkplayer-x86/src/main/libs
Try to import gradle project to your Android Studio and Run Ijk-Example for testing.
If you got this error
./compile-ijk.sh profiler build: NO
It is because of security policy of Apple in MacBook, so there is alternative solution for this to go to Apple menu-->System Preferences-->Security & Policy and Allow anyway it will prompt there.
Related
I tried to do what the instructions say here: https://github.com/rhdunn/espeak#android But as I am in Win10, and use Android Studio 2.3, don't know how to do these things in Windows? (Isn't there any step-by-step instructions for windows?)
Building with Gradle
Set the location of the Android SDK:
$ export ANDROID_HOME=<path-to-the-android-sdk>
Build the project:
$ ./autogen.sh
$ ./configure --with-gradle=<path-to-gradle>
$ make apk-release
This will create an android/build/outputs/apk/espeak-release-unsigned.apk file.
I am beginner with Android and I have to make a voip app and after searching I found that the better opensource library for that is PJSIP.
I download the below things to build the PJSIP library:
PJSIP from here
Android NDK
SWIG
...But I don't know how to start. I checked this link for the official PJSIP website but I didn't make any progress.
Which Directory do I have to put the Android NDK into?
How to use SWIG to build the PJSIP?!
which Directory i have to put the Android NDK ?
Put it where you want, later you will setup the path to it
$ export ANDROID_NDK_ROOT=/path_to_android_ndk_dir
how to use SWIG to build the PJSIP ?!
You don't need SWIG to compile the PJSIP sources, it's needed only if you want to build and and run the sample application PJSUA.
Updated
The steps to build sources are
Download sources from PJSIP site. Pay attention if you will compile on Windows machine download .zip file, if on Unix machine (including OS X) then download .bz2 file.
Go to pjlib/include/pj/ from the downloaded sources. Create (or overwrite) a file called config_site.h. Copy the following code snippet
#define PJ_CONFIG_ANDROID 1
#include <pj/config_site_sample.h>
Open Cmd or Terminal
Go to pjsip root folder (the downloaded sources)
$ cd /path/to/your/pjsip/dir
Export bash var ANDROID_NDK_ROOT as a environment variable. Variable value should be the path of android ndk directory.
$ export ANDROID_NDK_ROOT=/path_to_android_ndk_dir (Unix)
SET ANDROID_NDK_ROOT=/path_to_android_ndk_dir (Windows)
Perform build for target armeabi
$ ./configure-android
If you need to perform build for
target arm64-v8a do $ TARGET_ABI=armeabi-v8a ./configure-android --use-ndk-cflags
target armeabi-v7a do $ TARGET_ABI=armeabi-v7a ./configure-android --use-ndk-cflags
target x86 do $ TARGET_ABI=x86 ./configure-android --use-ndk-cflags
Compile sources
$ make dep && make clean && make
I am facing a problem. I have to add a PDF reader support to my Android App (now I'm using Mupdf but I need to change it).
I found PDFium project (https://code.google.com/p/pdfium/) and I think it is what I need for my needs.
I haven't too much experience in Android and I've not been able to build it for Android, I've followed the build instructions from here https://code.google.com/p/pdfium/wiki/Build with no good results.
Could you give some hint or advice to achieve build this tool in Android?
Thank you in advance!!!
How to build?
I recommend building on Linux (virtual machine will suffice),
because Windows is officially not supported and there are many problems on newer versions of OS X.
You will need about 60 GB of free space.
install OpenJDK 8
$ mkdir ~/android_src && cd ~/android_src or select any other path
$ repo init -u https://android.googlesource.com/platform/manifest -b android-7.1.1_r28
(detailed description available here)
$ repo sync and wait...
clone this repo (or download zip with its content)
replace makefiles in ~/android_src with corresponding makefiles from this repo
$ cd ~/android_src
$ source build/envsetup.sh
$ cd external/pdfium/fpdfsdk
$ lunch and select architecture
$ mma and wait ~5 minutes
library is available in ~/android_src/out/target/product/generic*/obj/lib/libmod*.so, copy it somewhere
$ rm -r ~/android_src/out before next build
It worked for me, but if doesn't work for you, try installing additional packages listed here.
Source
Build it within the AOSP
https://android.googlesource.com/platform/external/pdfium/
Use mm or mma instructions to build only the pdfium module
I've only successfully built the shared library but haven't take it into practice.
I am building Linphone application for android. I am using windows xp 32 bit.
1) Download android ndk
2) Installed the autotools: autoconf, automake, aclocal, libtoolize pkgconfig
3) run the ./prepare_sources.sh/
I got the output in terminal as
$ ./prepare_sources.sh /cygdrive/d/android/androidNdk/android-ndk-r8d
using /cygdrive/d/android/androidNdk/android-ndk-r8d as android NDK
./prepare_sources.sh: line 23: git: command not found
Applying patch to ffmpeg
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
|--- submodules/externals/ffmpeg/libavcodec/arm/int_neon.S.orig 2011-09-30 19:43:21.935593025 +0200
|+++ submodules/externals/ffmpeg/libavcodec/arm/int_neon.S 2011-09-30 19:44:21.115168033 +0200
File to patch:
Any info, questions or anything really is highly appreciated
Part 1
The following steps can help you create and install the build on your device or emulator(Tested on Mac):
Step1: you need to have the Android SDK and NDK configured and istalled
Also install Autotools Mac users can use this link (Follow point 2.3 only in the link)
Other platform users please make sure you install it correctly.
Step2: Mac users open up your terminal and clone the git repo on any directory you want
to by running the following command: (Other users sorry i don't know how but i think you can figure it out that how you can get the git repo on your directory using command promt or whatever you are using)
$ git clone git://git.linphone.org/linphone-android.git --recursive
After you get the Repo copied into your directory now go to the directory and open the README file and read out the whole file.
Step3: Now we will follow as the instructions written in README file
First Go to root directory of the downloaded project using the following command on Terminal:
Mac users on terminal write cd and
then drag and drop the "linphone-android" folder on terminal
(when you drag and drop the folder terminal will get the path of the folder and then you can hit enter to get into the directory of that folder)
$ cd /Users/myname/Desktop/Android/linphone-android
or just use simple command cd to get into the folder
$ cd Desktop
$ cd Android
$ cd linphone-android
Now when you get into the directory on terminal then check your PATH of SDK & NDK installed on your Mac run
$ echo $PATH
if you see the path with SDK and NDK location then it's ok to proceed with Step4 and skip the below part and if not then you need to setup the PATH before you execute the make and make install script in Step 4:
To set up path use :
$ export PATH=/Users/myname/Documents/adt-bundle-mac-x86_64-20130729/sdk/platform-tools:/Users/myname/Documents/adt-bundle-mac-x86_64-20130729/sdk/tools:/Users/myname/Documents/android-ndk-r9:$PATH
it's like export PATH=(Path of your SDK platform tools folder):(Path of your SDK tools folder):(Path of your NDK folder):$PATH
This will set up the path and to confirm again run
$ echo $PATH
Now you will see that the path of SDK and NDK is there.
Step 4: Now if the Path is already setup you can simply run
$ make
Now connect your Device to you Mac/Pc and see if eclipse has detected it.
After the device is connected run:
$ make install
$ make generate-sdk (optional)
This will install the application into your phone. (you need to have an working SIP username and password to configure in the app)
This above steps worked for me and i was able to get the app running on my device.
Part 2
Importing into Eclipse :
After you have made your build then now you need to import it into eclipse.
Step1: Go to eclipse click on File Menu then Import then select
Existing Android Code into Workspace
Hit Next and Browse to the linphone-android project folder
And Only tick linphone-android folder and Leave Copy project into workspace untick.
Do this Like the below image:
And hit finish.
Now you right click on "linphone-android" (project name) and go to Properties and Java Build Path and then Order and Export and then reorder them as my image below and untick gcm.jar
Hit OK
And Boom No errors
Now just run it on device or emulator. (Make sure your minimum target SDK matches with your device or emulator.)
The above steps worked fine for me and it will work for you as well.
All the Best !!
According to README in root dir of linphone-android you don't need to run prepare_sources.sh, remaining steps for you is to run "make" and "make install":
LINPHONE for ANDROID
**************
To build liblinphone for Android, you must:
0) download the Android sdk with platform-tools and tools updated to latest revision (at least API 16 is needed), then add both 'tools' and 'platform-tools' folders in your path.
1) download the Android ndk (>=r8b) from google and add it to your path.
2) install the autotools: autoconf, automake, aclocal, libtoolize, pkgconfig
2bis) on some 64 bits systems you'll need the ia32-libs package
3) run the Makefile script in the top level directory. This will download iLBC source files and convert some assembly files in VP8 project.
$ make
4) To install the generated apk into a plugged device, run
$ make install
Existing answers shows how to build old linphone but to Build Latest Linphone for Android You can follow these Steps:
1) First Download Android SDK (at least API 16 is needed)
2) Then Download Android NDK(>=r9d) from Google.
3) Then Install cmake, python, yasm nasm Dependencies which is further required while installing Linphone. you can install these tool through Terminal.
4) Then You have to download source code of Linphone using following command:
git clone git://git.linphone.org/linphone-android.git --recursive
5) After Downloading Source code You have to set Path of Android SDK,NDK and also JDK
in Android SDK You have to give path upto Tools.
For Example : in console type following command
export SDK_PATH=/home/rajesh/android/adt_bundle/sdk
export NDK_PATH=/home/rajesh/android/android-ndk-r10c
export JDK_PATH=/usr/lib/jvm/java-7-openjdk-i386/
export PATH=$PATH:$NDK_PATH:$SDK_PATH/platform-tools:$SDK_PATH/tools:$JDK_PATH
6) After setting path you have to navigate through Linphone directory and type command “./prepare.py” then This will configure the build and generate a Makefile in the top level directory.
If you get following error: CMake Error Could not find the intltoolize program then
Refer
http://lists.nongnu.org/archive/html/linphone-users/2015-07/msg00092.html
7) After setting path you have to navigate through Linphone directory and type command “make” then it will generate apk for Linphone.
8) To generate a liblinphone SDK zip containing a full jar and native libraries, run
$ make liblinphone-android-sdk
I hope this helps.
I am new to git and repo. I am in window 7 so I use cygwin. I have installed git from cygwin setup. After that I try to repo with the following command in cygwin.
$ repo init-u git://android.git.kernel.org/platform/manifest.git
I get an error like these:
bash: repo: command not found
I think I need to setup cygwin for repo. What do I need next to get repo?
Case 1: Not installed google repo yet?
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
Use the following checksums when required:
For version 1.25 it is
d06f33115aea44e583c8669375b35aad397176a411de3461897444d247b6c220
For version 1.26, it is 0cf5f52bcafb8e1d3ba0271b087312f6117b824af272bedd4ee969d52363a86b
Case 2: Already have google repo Installed, still wondering what went wrong ?
Add
PATH=~/bin:$PATH to the end of file ~/.bashrc
and then run
source ~/.bashrc
You still need to install repo. repo is a third party tool built on top of git. See:
http://source.android.com/source/downloading.html
for how to install
I have the same problem and I have to do:
$ PATH=~/bin:$PATH every time I repo sync but at least it works.
add line
export PATH=~/bin:$PATH in file ~/.bashrc
edit .bash_profile and uncomment these fields. (any text editor will do)
# Set PATH so it includes user's private bin if it exists
# if [ -d "${HOME}/bin" ] ; then
# PATH="${HOME}/bin:${PATH}"
# fi
Restart CYGWIN.
Check and see if you have both .profile & .bash_profile in the working directory.
If you do, it's possible that the export command in both is actually conflicting in your shell. Making the output look something like this in Windows...
PATH="C:/Windows/path/to/repo/Windows/path/to/repo:$PATH"
export PATH
That's what happened to my bash shell anyway. It is correct that the 2 files interact with Bash or Cygwin differently, however if you have redundant inputs, they will compile together...
This answer for android build system error
For Python 3
If you get a "/usr/bin/env 'python' no such file or directory" error message, use one of the following solutions:
If your Ubuntu 20.04.2 LTS is a newly installed (vs. upgraded) Linux version:
sudo ln -s /usr/bin/python3 /usr/bin/python
f using Git version 2.19 or greater, you can specify --partial-clone when performing repo init. This makes use of Git's partial clone capability to only download Git objects when needed, instead of downloading everything. Because using partial clones means that many operations must communicate with the server, use the following if you're a developer and you're using a network with low latency:
repo init -u https://android.googlesource.com/platform/manifest -b master --partial-clone --clone-filter=blob:limit=10M
you can see document in
Downloading the Source