Ext.: http://blog.chinaunix.net/uid-26611383-id-3678766.html
Due to the needs of the project, a player that can support the RTSP protocol on the Android platform has not experienced the Android platform before, so the VLC player of the famous video LAN has been found, even more surprisingly, the player is still fully open source. In this respect for the authors and organizations of open source software, your presence has made the computer software industry flourish, and you have helped a lot of shy individuals and businesses, giving them the opportunity to use high-quality software, and inevitably attract a group of people with lofty ideals to join your industry.
Since there are ready-made code, so I would like to compile VLC for Android code, after a few days of tossing, finally compiled successfully, and successfully run on the Android platform, during the search of a lot of information, also encountered very problems, here to do a summary, but also sincerely hope that will give you some help, If you have this aspect of the problem, welcome to my message, as long as the ability to do so, there is time will certainly give the answer, study together.
The past few days have been doing VLC ndroid source code compilation and porting work, first of all, to compile the Android code needs to pay attention to several issues:
1. Linux platform, I use ubuntu12.04, compiling VLC for Android source code is best on the latest platform, I previously compiled on the ubuntu10.04, encountered a lot of problems, most of which is the software version is too low, do not meet the requirements, and finally changed to 12.04, before a lot of problems will not be reproduced.
2. It is best to switch to the root user to compile, otherwise there will be a lot of permission denied similar problem, that is, do not have permission to execute some scripts and create some files
3. Compile the inevitable encounter some problems, even error and lead to compile termination, at this time must see the print out the hint or system log, most of the problems are easy to solve, avoid impatient air.
OK, the following is my specific compilation steps, online many netizens also mentioned, is basically those steps, maybe those steps are for the previous VLC for Android version, slightly there will be some differences.
In the 64-bit system to pay attention to the installation of 32-bit system library files, I found that I downloaded 64-bit SDK files inside the ADB or 32-bit, so need to install 32-bit library, otherwise 64-bit Ubuntu is not able to run with 32-bit program.
One: Install Android SDK, NDK, JDK three tools, SDK is for Android system, some SDK also contains eclipse,
The NDK is used to compile C + + code, which makes it possible for an Android application to invoke a C + + program through Java, not to mention a Java runtime environment.
Jdk:http://www.oracle.com/technetwork/java/javase/downloads/index.html
Sdk:http://developer.android.com/sdk/index.html
Ndk:http://developer.android.com/tools/sdk/ndk/index.html
Download the latest version and unzip it into your working directory.
Two: According to the first step to extract the three tools, configure the environment variables (PATH) of these three tools, many ways, can modify ~/.bashrc/etc/profile and so on, this step must be correct, otherwise the system will not find the three tools, the subsequent compilation will use these tools, Of course, it will make a mistake, because the system does not know the location of these programs by default, which is the same as the environment variables under Windows. In order to verify that the environment variables are configured correctly, you can run these programs in a different directory, such as in the root directory to see if you can run the Ndk-build adb program, or Echo $PATH print the current environment variables and verify them. This step is very simple, seems to say a bit more nonsense. The following is the environment variables I added, need to be modified according to personal circumstances, XXXX represents the above three programs extracted directory.
Export path=xxxx/sdk/platform-tools:xxxx/android-ndk-r8e: $PATH
Export java_home=xxxx/jdk1.7.0_21
Export JRE_HOME=${JAVA_HOME}/JRE
Export Classpath=.:${java_home}/lib:${jre_home}/lib
Export Path=${java_home}/bin: $PATH
Three: Download VLC-dependent library files and some tools to use
Sudo Apt-get Install Git-core
Sudo apt-get Install Ant
Sudo Apt-get Install Libtool
Sudo Apt-get Install CMake
Sudo Apt-get Install Autopoint
Four: Set the variables to be used at compile time, the generated makefile will use these variables
Export ANDROID_SDK=XXXX/SDK
Export android_ndk=xxxx/android-ndk-r8e
Export path= $PATH: $ANDROID _sdk/platform-tools: $ANDROID _sdk/tools
Export android_abi=armeabi-v7a
Note: The final export android_abi=armeabi-v7a this step needs to be based on each Android platform, you can execute the ADB shell link to the Android platform, and then Cat/proc/cpuinfo Check if your platform is armv7, support neon, and modify it as appropriate
V: Get the configuration Code
git clone git://git.videolan.org/vlc-ports/android.git
Then go to the Android directory and execute./compile.sh, this script will execute all the tools needed to get VLC source code, various dependent files, compile, finally compile, generate so files, and finally generate the APK file. However, the execution of this script is not unexpected, there will be a variety of problems, otherwise compiling this Android code is too easy. According to the error prompt to resolve, most of the files are given the download link error, as well as permissions issues. This process takes a long time, typically several hours, because the download is slow and is a server problem that the script gives the link to. These files can be downloaded and put into the Vlc/contrib/tarballs directory, presumably including the following installation packages
Finally build successfull, originally prepared to build the dynamic library so and apk file to be put here for everyone to download, but these files are relatively large, usually several m some dozens of m, we still more toss, as long as determined, the final will certainly compile successfully.
Note: Follow the above steps, I myself in the compile time, encountered problems and query related information summary:
1. Error occurred in compiling: reconf autoconf failed. On the StackOverflow, someone said to change ubuntu12.04 to ubuntu13.04 to succeed, I installed ubuntu13.04, recompile VLC for Android, still appear this problem (Niang, spent my day to install, compile), Later in my "http://blog.csdn.net/gfocean/article/details/5266847" blog, I learned that to install under Ubuntu "Libtool.deb", and then compile, problem solving.
2, VLC for Android compilation has official documents, wrote very detailed: https://wiki.videolan.org/AndroidCompile/. VLC for Android source code in: http://git.videolan.org/
3. When compiling VLC for Android, use the Linux ANDROID19 SDK, And dl-ssl.google.com was sealed, then I used webmaster Tools website Super Ping function, find can access dl-ssl.google.com IP address, put in the Hosts file mapping, and then start the SDK on Ubuntu Manager tool, select the ANDROID19 SDK download is ok.
4, compile VLC for Android, encountered some installation package cannot download the problem, at this time you can manually fq download these installation packages, put them in the appropriate location (through the printed log can know the location).
5, after installing ubuntu13.04, use Apt-get install Openssh-server, prompt find address, later I put the system Apt-get source updated a bit, and then use the command to install successfully. Refer to Http://www.cnblogs.com/zhangpengshou/p/3591387.html
I believe everyone can compile successfully, I am the first time to compile a professional library files, or a sense of accomplishment.
Linux under compile VLC for Android source code summary