`
zsnlovewl
  • 浏览: 178101 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

VLC for Android on Linux

 
阅读更多

来自:http://wiki.videolan.org/AndroidCompile

 

This page is an introduction to the compilation of VLC for Android on Linux.

Contents

 [hide

Eclipse, SDK and NDK installation

Requirements

  • You MUST be on Linux, and a recent one.
  • You MUST have installed: apache-ant (or ant ), autoconf , automake , autopoint , libtool , gawk (or nawk ), gcc , g++ , pkg-config , cmake , patch , subversion , and very up-to-date versions of those tools.
  • You MUST install: git .

Android SDK

  1. Create a working directory android .
  2. Go to Android SDK page and download the latest SDK for linux.
  3. Decompress into android folder.
  4. Run tools/android (from the command line you can also run: "tools/android update sdk -u -t platform,platform-tool,extra")
  5. In the tool, install "SDK Platform Android 4.0, API 14" , and follow the instructions.

You can have more details , if needed.

Android NDK

  1. Check that the SDK installation is correct.
  2. Go to Android NDK page and download the latest NDK for linux.
  3. Decompress into android folder, next to your android-sdk-linux folder.

Eclipse

As used by your distribution, install Eclipse with your package manager:

apt-get install eclipse (debian)
yum install eclipse (Fedora)
pacman -S eclipse (Arch)
emerge -av eclipse-sdk (Gentoo)
...

And run it, at least once, and then quit eclipse.

Note: On Debian-based distributions it is better to download Eclipse indigo builds from the official website: http://www.eclipse.org/downloads/ , otherwise it can lead to an error when importing the ADT plugin (see following).

ADT

The ADT plugin is required to compile on Android.

  1. Go to ADT page .
  2. Start Eclipse, then select Help > Install New Software....
  3. Add the "ADT Plugin" repository with https://dl-ssl.google.com/android/eclipse/ as URL
  4. Validate and select the checkbox next to Developer Tools and click Next, Next, Finish.
  5. Restart Eclipse.
  6. Go to Menu > Window > Preferences... and then Android from the left pane.
  7. Point the SDK Location in to your downloaded SDK directory.
  8. Ok, and quit Eclipse.

See extra information here .

Environment setup

Set $ANDROID_SDK to point to your Android SDK directory

export ANDROID_SDK=/path/to/android-sdk

Set $ANDROID_NDK to point to your Android NDK directory

export ANDROID_NDK=/path/to/android-ndk

Add some useful binaries to your $PATH

export PATH=$PATH:$ANDROID_SDK/platform-tools:$ANDROID_SDK/tools

Devices

You need to export the ABI for your device. armeabi-v7a is for devices with ARMv7 or above, any other device uses armeabi .

export ANDROID_ABI=armeabi-v7a

or

export ANDROID_ABI=armeabi

If you plan to use an armeabi-v7a device that does not support NEON, you need a build without NEON

export NO_NEON=1

If you plan to use an armeabi device that does not support FPU, you need a build without FPU

export NO_FPU=1

If you plan to use an ARMv5 armeabi device (read: Android Emulator), you need a build without ARMv6

export NO_ARMV6=1

Examples

  • For a normal (2012 consumer phone or tablet), like Cortex-A8 or Cortex-A9
export ANDROID_ABI=armeabi-v7a
  • For a Tegra2 device
export ANDROID_ABI=armeabi-v7a
export NO_NEON=1
  • For an ARMv6 device
export ANDROID_ABI=armeabi
  • For an ARMv6 device without FPU
export ANDROID_ABI=armeabi
export NO_FPU=1
  • For an ARMv5 device or the emulator
export ANDROID_ABI=armeabi
export NO_ARMV6=1

Those exports must be set at all times, notably for the contribs and the configure.

Building

Get VLC Source

Clone the source from the VLC git!

In your android folder, run:

git clone git://git.videolan.org/vlc-ports/android.git

 

Compile

Read compile.sh first, as it contains some very useful and important information. Then run it:

sh compile.sh

Note: At this point, you will get an autogenerated debug apk in the bin/ folder, signed with a debug key.

In order to build a non-debug package:

sh compile.sh release

Note: At this point, you will get an unsigned release apk in the bin/ folder, which you will have to sign and zipalign .

Package in Eclipse [optional]

  1. In Eclipse, create a new Android Project from existing source by importing from the vlc-android path.
  2. Export unsigned/signed apk.

Note: Building against JDK6 is recommended for optimal compatibility (Set Java Compiler Compliance to 1.6).

Run

Run it and enjoy!

Debugging

Here are some helpful links if you wish to debug VLC on Android:

Troubleshooting

Outdated Awk

If you receive the error message while building:

Android NDK: Host 'awk' tool is outdated. Please define HOST_AWK to point to Gawk or Nawk !    

The prebuilt version of Awk that comes with the Android NDK is outdated. Defining HOST_AWK in your environment does nothing as the system still tries to just the one that comes with the Android NDK. To get around this issue, simply rename or delete the Awk binary that comes with the Android NDK. For example to move it:

mv $ANDROID_NDK/prebuilt/linux-x86/bin/awk $ANDROID_NDK/prebuilt/linux-x86/bin/awk.old

Can't find Ant

If you're new to Ant, please be aware that some Linux distributions don't install it in the usual spot as with other programs. Try checking to see if the directory /usr/share/java/apache-ant/bin exists and add it to your path.

Outdated autotools-dev

If you get the following error message you may have have an outdated version of autotools-dev:

 Invalid configuration `arm-linux-androideabi': system `androideabi' not recognized

You may first want to check if your distribution has any available updates for this package. Alternatively, you can manually update your config.guess and config.sub files from here: [1] . These files are typically located in /usr/share/misc on Debian based distributions.

分享到:
评论
发表评论

文章已被作者锁定,不允许评论。

相关推荐

    vlc compile for android

    This page is an introduction to the compilation of VLC for Android on Linux

    Cygwin 编译 VLC 指南.doc

    Cygwin提供了大量的GNU工具和库,使得开发者能够在Windows环境下进行类似于Linux或Unix的开发工作。在本指南中,我们将详细介绍如何在Cygwin环境下编译VLC媒体播放器。 ### 1. 安装Cygwin #### a. 从Internet安装 ...

    UMP Pro Win Mac Linux WebGL 2.0.3(u5.3.0).txt

    - For correct work with UMP Pro (Android, iOS) package at first import UMP Pro (Android, iOS) package and after it import UMP Pro (Win, Mac, Linux) package in your project; Main features: + Included ...

    Qt基于Phonon做的视频播放器

    Qt是Trolltech(现为The Qt Company)开发的一款C++库,支持Windows、Linux、macOS、Android和iOS等多个操作系统。Qt的核心特性包括事件驱动的图形用户界面(GUI)、网络编程、数据库访问、多线程以及本地文件操作等...

    fedora 10 bible

    **Fedora 10** 是一款强大的 Linux 发行版,它为用户提供了全面且灵活的操作系统解决方案。该版本不仅适用于技术爱好者和技术人员,同时也非常适合新手用户。本书《Fedora 10 Bible》是一本深入浅出地介绍 Fedora 10...

Global site tag (gtag.js) - Google Analytics