library and sample to access to UVC web camera on non-rooted Android device
Copyright (c) 2014-2017 saki [email protected]
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
All files in the folder are under this Apache License, Version 2.0. Files in the jni/libjpeg, jni/libusb and jin/libuvc folders may have a different license, see the respective files.
The Gradle build system will build the entire project, including the NDK parts. If you want to build with Gradle build system,
- make directory on your favorite place (this directory is parent directory of
UVCCamera
project). - change directory into the directory.
- clone this repository with
git clone https://github.com/saki4510t/UVCCamera.git
- change directory into
UVCCamera
directory withcd UVCCamera
- build library with all sample projects using
gradle build
It will takes several minutes to build. Now you can see apks in each {sample project}/build/outputs/apks
directory.
Or if you want to install and try all sample projects on your device, run gradle installDebug
.
Note: Just make sure that local.properties
contains the paths for sdk.dir
and ndk.dir
. Or you can set them as enviroment variables of you shell. On some system, you may need add JAVA_HOME
envairoment valiable that points to JDK directory.
If you want to use Android Studio(unfortunately NDK supporting on Android Studio is very poor though),
- make directory on your favorite place (this directory is parent directory of
UVCCamera
project). - change directory into the directory.
- clone this repository with
git clone https://github.com/saki4510t/UVCCamera.git
- start Android Studio and open the cloned repository using
Open an existing Android Studio project
- Android Studio raise some errors but just ignore now. Android Studio generate
local.properties
file. Please openlocal.properties
and addndk.dir
key to the end of the file. The contents of the file looks like this.
sdk.dir={path to Android SDK on your storage}
ndk.dir={path to Android NDK on your storage}
Please replace actual path to SDK and NDK on your storage.
Of course you can make local.properties
by manually instead of using automatically generated ones by Android Studio.
6. Synchronize project
7. execute Make project
from Build
menu.
If you want to use build-in VCS on Android Studio, use Check out project from Version Control
from https://github.com/saki4510t/UVCCamera.git
. After cloning, Android Studio ask you open the project but don't open now. Instead open the project using Open an existing Android Studio project
. Other procedures are same as above.
If you still need to use Eclipse or if you don't want to use Gradle with some reason, you can build suing ndk-build
command.
- make directory on your favorite place.
- change directory into the directory.
- clone this repository with
git clone https://github.com/saki4510t/UVCCamera.git
- change directory into
{UVCCamera}/libuvccamera/src/main/jni
directory. - run
ndk-build
- resulted shared libraries are available under
{UVCCamera}/libuvccamera/build/src/main/libs
directory and copy them into your project with directories by manually. - copy files under
{UVCCamera}/libuvccamera/build/src/main/java
into your project source directory by manually.