Building libuvc on Ubuntu

1
git clone https://github.com/saki4510t/UVCCamera.git

打开Android Studio,File->Open打开UVCCamera文件夹。

修改Project/build.gradle文件,修改以下部分:

1
2
3
4
5
6
7
8
9
10
ext {
supportLibVersion = '27.1.1' // variable that can be referenced to keep support libs consistent
commonLibVersion= '2.12.4'
versionBuildTool = '27.0.3'
versionCompiler = 27
versionTarget = 27
versionNameString = '1.0.0'
javaSourceCompatibility = JavaVersion.VERSION_1_8
javaTargetCompatibility = JavaVersion.VERSION_1_8
}

File->Project Structure,修改Android SDK location和Android NDK location,例如Android SDK location: /home/luohanjie/Android/SdkAndroid NDK location: /home/luohanjie/Android/Sdk/ndk/android-ndk-r21

修改Project/libuvccamera/src/main/jni/Application.mk,

1
2
3
4
APP_PLATFORM := android-21
APP_ABI := armeabi-v7a arm64-v8a x86_64
#APP_OPTIM := debug
APP_OPTIM := release

然后Build->Make Project。