Build Android Applications Based on FFmpeg getting Error - android

I have download code this link
Import this project and convert it in to C / C ++ native project.
And also set Builder Settings to Build Command
bash C:\tools\android-ndk-r8b-windows\android-ndk-r8b\ndk-build
After run project then i am getting below Error.
make: *** Android NDK: Aborting . Stop. FFmpegTest
C:\tools\android-ndk-r5b\build\core\prebuilt-library.mk
I am develop above application in Windows 7 64 bit and Eclipse Juno.
Please guide me to resolved my Error.
Thanks

I was never able to compile ffmpeg for Android following the link you have posted (though I've heard others did succeed) same as I was never able to compile ffmpeg for Android under windows.
I have easily compiled ffmpeg under ubuntu using the following code
http://code.google.com/p/dolphin-player/.
Just go to
dolphin-player/p/native/ffmpeg/ffmpeg-0.11.1 and run build_android_r8.sh from there
Once compiled under unix you can then use the resulting *.so under windows.
You can emulate unix under windows using something like the free VirtualBox.
You can avoid compiling altogether by grabbing one of dolphin-player's apks (suitable for your architecture) renaming it into zip and extracting libffmeg.so from there.

Related

pjsip2 issue during build

I'm trying to use pjsip library for sip telephony in an android device for different architectures on a MAC.
I have downloaded 2.5.5 from http://svn.pjsip.org/repos/pjproject/tags/2.5.5 which is build fine for armabi architectures with the corresponding libpjsua2.so.
I'm trying to build it for other architectures as well but with no much lack on it. I have followed the instructions from https://trac.pjsip.org/repos/wiki/Getting-Started/Android but I have different errors.
For instance having TARGET_ABI=armeabi-v7a ./configure-android --use-ndk-cflags I was getting at the beginning:
/Users/*****/Library/Android/sdk/ndk-bundle/samples/hello-jni: No such file or directory. Stop.
configure-android error: failed to run ndk-build, check ANDROID_NDK_ROOT env var
I downloaded the samples from github (as suggested in Android NDK) and now I get another error:
Users/iu/Library/Android/sdk/ndk-bundle/build/core/build-local.mk:151:
*** Android NDK: Aborting . Stop. ./configure-android: line 72: test: argument expected configure-android error: compiler not found,
please check environment settings (TARGET_ABI, etc)
Any suggestions?
Thanks
Just in case somebody has a similar issue. The way I solved it is by building it on a linux machine as described in
https://github.com/VoiSmart/pjsip-android-builder
For Android, I suggest, you build pjsip 2.6.
And yes, build it on Linux.
It has fixed many SIGSEG errors that occurred in 5.x versions.
Since we switched to 2.6 the stability of our app increased significantly.
It may happen, that another build issue arises with 2.6 that correlates with libYUV if you compile together with openSSL.
If you do not need video, disable it in the build (config_site.h).

How to build linux command for Android on Linux machine

Since there are a few commands missing on Android, I want to build them by myself.
Take one as an example:
There is no dig command on Android.
I've got the source code from ftp://ftp.isc.org/isc/bind9/9.2.3/bind-9.2.3.tar.gz and then I want to build it. But I got stuck.
How can I build the executable on my linux machine?
You can do it in two ways.
To build any C Source code for Android Platform you can use Android NDK Toolchian, It lets you build Native code for another platform.
It can be used as a stand-alone compiler without an Android APK.
Documentation and Sample Code.
To build it as an executable (without APK) and not shared object, replace include $(BUILD_SHARED_LIBRARY) with include $(BUILD_EXECUTABLE) in Android.mk.
For Linux commands on Android you can use Busybox.
It supports most of the commands.
However dig is not supported in busybox, you can add it by following this article.
Hopefully this gives you a start.

Using libVLC for Android on windows platform

I'm trying to explore libVLC for Android that's why setting up VLC android project on windows 7 but i'm facing problems. When i import the project and setup all helping libraries and try to compile using NDK it gives following error
make.exe: *** No rule to make target `jni/..//modules/codec/omxil/iomx.cpp',
needed by `obj/local/armeabi/objs-debug/iomx gingerbread/__//modules/codec/omxil/iomx.o'. Stop.
While when i try to search the file in my folder i only able to find iomx.h and iomx.cpp is actually missing but i downloaded the project from official repository.
git clone git://git.videolan.org/vlc-ports/android.git
I'm willing to follow a tutorial with proper configurations to setup and compile android application of VLC but i'm not able to find any tutorial and the official one says that it is for Linux and you will require a Linux or Mac OSX to follow this tutorial Tutorial Link. So my first question is
Can we Compile VLC android project Using all mentioned tools like (Android SDK, NDK, ant etc) on a windows platform.
Secondly i'm not able to find a detailed or much easy Documentation except this one VLC Documentation link, Are there any other easy to understand libVLC documentation more specific to android usage
Please help me or guide me in right direction. I want to develop an application for Docked DVD device for android.
I found my answer about this by myself and today watched this question unanswered so thought to answer it so that it can be helpful for others.
For the first part the answer is 'NO' we cannot compile the libVLC code on Windows OS using NDK as due to complex compilation process of libVLC. it Cannot be compiled using NDK tools that's why VLC released a script to compile libVLC which is in main directory when you download code from Git repository named Compile.sh and it can be run only on linux or mac as both based on Unix. i.e for libVLC compilation you need to run compile.sh which requires alot of linux based tools as mentioned in their official tutorial for compilation. you can try all those packages through cygwin on windows but i have not tried that rather i switched to Ubuntu 13.04 so that i can also explore linux environment...:). One thing i like to mention here if your target is just to use the compiled C++ code of libVLC in your project through java then you can do this on windows OS using libVLC.so file but if you need to change the libVLC code and recompile it then you will need to run compile.sh which requires linux or mac.
For the Second one the answer is same that as far as i know the only documentation i found was that i mentioned in my question.

cocos2dx: from win32 project to android project

Sorry it's my first time with cross-platform programming and I spent 4 hours for naught this afternoon.
I currently have a cocos2dx win32 project. I can run it on Visual Studio. My mentor told me to find a way to convert it to an android project. I have followed the instructions to set up the android environment, so I have: the recommended ADT (modified eclipse), NDK, and cygwin. Honestly I do not really know what NDK and cygwin is for. I have never played with linux either. Is there an informative page for how they work? All the pages I found are how-to-set-up-environment.
I think I set up the environment just ok, because I built a default helloworld project and ran it on the ADK emulator. However, I find no way to convert the win32 project I have to an android project.
I also found that in the folder of my project there is a .bat file called create-android-project.bat. And I followed some instructions from online to set up the three parameters for this batch file: the package path, project name, and target id. However the batch failed with errors like "No such file or folder...". I tested with other win32 projects I have. Ended up with similar errors.
Interestingly, if I ran this batch in the original cocos2dx project (the one with samples, templates, and built multi-platform projects), the batch ran just fine.
I really don't know what to do now. Can any one give me a solid guide page on this? Thanks a lot!
You need the classes and resources folder in the project created. Once done, you need to add all the CPP files and the includes folder in Android.mk file and build it using a script available build_native.sh
For cocos2dx v3, you need to run cocos compile -p android from within the project's directory. You need to make sure to have your JAVA_HOME path set correctly in your environment variables.
I can't say for sure that it mattered, but I had run proj.android/build_native.py as admin through cmd.exe before hand.
I have successfully converted my Cocos2d-x 2.1.5 project to Android project with the reference with this link. And I conclude some problems I met in my Blogger. I also found an official tutorial
To conclude:
Setup Java Build Path
Setup Builder Settings, I didn't use cygwin but using ndk_build
Setup NDK_MODULE_PATH
Copy the Resources
Modify Android.mk

Installing & using the Android NDK in Eclipse

I've been running the Android SDK for a while now in Eclipse (MAC OSX). I've downloaded the NDK and installed the C/C++ tools in Eclipse, but could anyone guide me on using the NDK? For example, do I just create an Android project like normal and build it with the NDK instead?
Really could do with a decent tutorial if anyone know of any.
EDIT: OK so I have the NDK installed now (I think) but does anyone have any idea how to use it? I got as far as this (taken from here):
Run Terminal
cd ~/android-ndk-1.5_r1
make APP=hello-jni
In order to run the hello-jni sample application, but I get an error in terminal saying:
Android NDK: APP variable defined to
unknown applications: hellojni
Android NDK: You might want to use
one of the following:
build/core/main.mk:81: *** Android
NDK: Aborting . Stop.
Any ideas why?
As simply as I can describe it, building an Android app from within Eclipse that uses the NDK requires two steps.
First, inside your terminal you need to run the NDK build script on your project. cd into the root of your project directory and then execute the ndk-build script within that directory.
For example:
cd ~/workspace/hello-jni
./~/android-ndk-1.5_r1/ndk-build
After doing this, you should see some output that results in the creation of a *.SO file within the obj directory within your project directory.
Once you have the *.SO file, the final step to building an application with the Android NDK through Eclipse is to build it with Eclipse like you would any other application and then deploy it for testing.
If you make any changes to the C/C++ code you'll need to repeat step one and regenerate your *.SO file before building and deploying your application from within Eclipse again.
I would like to note that by using the Android NDK your android apps are still based upon Java. They're just communicating with code written in C/C++ by way of the Java Native Interface.
Finally, I am not aware of any Eclipse plugins that will aid with NDK development. Everything I know about the NDK I have learned the official Android NDK documentation. Please feel free to comment and let me know if there anything I can clear up in my response.
Native development and debugging support came into Eclipse environment as of ADT version 20. http://tools.android.com/recent/usingthendkplugin
Set path to NDK from Eclipse Preferences -> Android -> NDK
Right-click on your project and choose Android Tools -> Add Native Support
developer.android.com states you also need Cygwin.
http://developer.android.com/tools/sdk/ndk/index.html#Contents
Required development tools
For all development platforms, GNU Make 3.81 or later is required. Earlier versions of GNU Make might work but have not been tested.
A recent version of awk (either GNU Awk or Nawk) is also required.
For Windows, Cygwin 1.7 or higher is required. The NDK will not work with Cygwin 1.5 installations.
The docs directory in the NDK has some pretty good information on how to use the NDK itself. Read the overview, Application.mk, and Android.mk HTML docs. You'll want to google for the Sun JNI PDF, download it, and learn what JNI is all about before you go any further. This is because simply compiling a bunch of C/C++ code into libraries with the NDK is only part of the process. You have to write native Java code that calls your C/C++, and you have to create wrapper functions in C/C++ that adhere to JNI conventions that the native Java code can invoke. JNI has been around a long time, it's not Android specific by any means. So, you can, to learn about it, go quite far following tutorials geared towards JNI, using command line tools like javah and javac, and then return to integrating with the NDK after you know the basics. (For an example of what these C shims look like, take a look at the hello-jni sample in the NDK; the C source file there shows you typically what the shims look like. Using javah to generate these shims is the way to go, you create Java classes that have native methods, process them with javah, and it generates the C headers for you, then you code up C functions that adhere to the generated function prototypes).
Note: while the NDK docs would have you manually building from command line and then going into Eclipse to build your app (a laborious sequence of steps, to be sure, especially if you are changing the C/C++ code), it turns out you can integrate easily with Eclipse so that the NDK is run each time you build from Eclipse. To see how, read here.
This is for benefit of others who want to create the project from scratch from within eclipse: I followed steps mentioned here in this blog here and it works fine: http://mhandroid.wordpress.com/2011/01/23/using-eclipse-for-android-cc-development/
To attempt to answer the question directly - you need to run ndk-build in the folder with the native code within your project folder. This creates the .so files found in the file explorer/resources tree under jni in Eclipse. These functions, if the syntax in the code is correct, can now be called from your java code.
I found many sources of help when install and getting to grips with Android Developer Tools and the NDK. I wrote a blog post to share my experiences and hopefully give back to the community that helped me get there which may help understand my answer: http://workingmatt.blogspot.co.uk/2013/03/set-up-android-sdk-and-ndk.html

Categories

Resources