-
Notifications
You must be signed in to change notification settings - Fork 94
Build From Source
- Prerequisites
Install the following softwares on your computer.
- git
- cmake
- Android SDK (r21)
- Android NDK (r9d+)
- Android Studio or ADT (Eclipse)
If you are trying to build on Windows machine, please refer to "for Windows users" section.
- Obtain source code
Open terminal and input the following commands.
# clone repository
git clone https://github.com/h6ah4i/android-openslmediaplayer.git
cd h6ah4i-android-openslmediaplayer
# clone submodules
git submodule init
git submodule update
# change shell program (NOTE: this step is only required for Windows user)
bash
# download third party libraries
./library/src/main/dep_libs/cxxdasp/android/dep_libs/download_dep_libs.sh
- Import Non-Android Studio project -> Select
[repository]/android-studio/OpenSLMediaPlayer
directory - Open local.properties file and append the following line
ndk.dir=[path to ndk installed directory]
- Build -> Make Project
-
Import android-suport-v7-appcompat and android-suport-v7-gridlayour libraries
- File -> Import...
- Select "Existing Android Code into Workspace" and click Next
- Specify
[android sdk]/extras/android/support/v7
- Select the following projects to import
- appcompat (android-suport-v7-appcompat)
- gridlayout (android-suport-v7-gridlayout)
- Check "Copy projects into workspace"
- Click "Finish"
-
Import OpenSLMediaPlayer projects
- File -> Import...
- Select "Existing Projects into Workspace" and click Next
- Specify top directory of the cloned this repository
- Select the following projects to import
- OpenSLMediaPlayer
- OpenSLMediaPlayerExample
- OpenSLMediaPlayerTest
- Uncheck "Copy projects into workspace"
- Click "Finish"
-
Fix project property
- Open properties dialog of the OpenSLMediaPlayerExample project
- Fix reference errors of
android-suport-v7-appcompat
andandroid-suport-v7-gridlayout
-
Project -> Build All
-
Import OpenSLMediaPlayerNativeAPIExample project
- File -> Import...
- Select "Existing Projects into Workspace" and click Next
- Specify top directory of the cloned this repository
- Select the following project to import
- OpenSLMediaPlayerNativeAPIExample
- Click "Finish"
-
Project -> Build All
-
I recommend to use cmder (full version) for terminal app and GNU make can be downloaded from here. (put make.exe into the cmder/bin directory)
-
Avoid deep path name place or use subst command
Gnu make and compiler (maybe other mingw commands) affects MAX_PATH (=260 chars) limitation
SUBST X: C:\media\android-openslmediaplayer
-
ADT is not recommended, please use Android Studio.
I have tried to import and build with ADT on Windows, but I was not able to build properly. Eclipse seemed be hanged up during the build sequence because ndk-build (make.exe) process was never stopped even after finished to create .so files. I don't know what's wrong, but the above procedure works on Linux and OS X.