# readme.txt

Description of the archive contents and any dependencies needed to build the source code.

## Content

This archive contains 2 directories.
/source : it contains the source.
/binary : it contains 2 files. The SATE_Mobile_TestCase_2017_0001.apk file and the environment_info.txt file that describes the build environment and all the dependencies needed.

## Build Instructions for VLC Android App

The following build instructions have been tested under Ubuntu Xenial 16.04 64bit. 
Since VLC has thousands of dependencies and requires for some very recent versions, 
we highly recommend that you use the same OS distribution.

Under a fresh install of Ubuntu 16.04, start by upgrading your system:

	Sudo apt-get update
	Sudo apt-get upgrade



## VLC Dependencies

Since we are building on a 64bit machine, we need to install some 32bit dependencies required by Google precompiled libraries:

	sudo dpkg --add-architecture i386
	sudo apt-get update

Let’s install all the dependencies:

	sudo apt-get install -y autoconf m4 automake ant autopoint cmake \
	    build-essential libtool libtool-bin patch pkg-config ragel subversion \
	    git rpm2cpio libwebkitgtk-1.0-0 yasm ragel g++ protobuf-compiler protobuf-c-compiler \
	    gettext libgsm1-dev wget expect unzip python ffmpeg libgnutls-dev \
	    openjdk-8-jre openjdk-8-jdk \
	    zlib1g:i386 libstdc++6:i386 libc6:i386

VLC needs protobuf 3, which is not packaged by default with Ubuntu (you’ll get version 2.x). We need to grab it ourselves:

	git clone https://github.com/google/protobuf.git
	cd protobuf

	sudo apt-get install curl

	./autogen.sh
	./configure
	make
	make check
	sudo make install
	sudo ldconfig		// refresh shared libraries cache

At this point, all the dependencies should be installed on your system.



## Android SDK and NDK

VLC needs a specific version of the NDK library: r14b at the time of writing. 
In your home directory, or in the /opt directory depending on your preferences:

	mkdir sdk && cd sdk && \
	wget http://dl.google.com/android/repository/android-ndk-r14b-linux-x86_64.zip && \
	unzip android-ndk-r14b-linux-x86_64.zip && \
	rm -f android-ndk-r14b-linux-x86_64.zip && \
	ln -s android-ndk-r14b android-ndk && \
	mkdir android-sdk-linux && \
	cd android-sdk-linux && \
	mkdir "licenses" && \
	echo "8933bad161af4178b1185d1a37fbf41ea5269c55" > "licenses/android-sdk-license" && \
	wget https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip && \
	unzip sdk-tools-linux-3859397.zip && \
	rm -f sdk-tools-linux-3859397.zip && \
 

At this point, you successfully installed the Android SDK and NDK. We need to do one last thing, set up environment variables so the project knows where you installed the SDK. 
Go ahead and run:

	export ANDROID_SDK=/path/to/android-sdk-linux
	export ANDROID_NDK=/path/to/android-ndk
	export PATH=$PATH:ANDROID_SDK/platform-tools:ANDROID_SDK/tools



## VLC Android App

Finally we are ready to build VLC mobile app. First, go to "source" directory.

You can now run the script `compile.sh`:

sh compile.sh

If you need to compile for a specific architecture, run `sh compile.sh -h` to see the available choices, and then: sh compile.sh -a <architecture>

E.g: sh compile.sh -a x86
