On production devices that have access to Google Play Market (and Internet) these packages will be
installed from Market on the first start of an application using OpenCV Manager API.
But devkits without Market or Internet connection require this packages to be installed manually.
Install the Manager.apk and optional binary_pack.apk if it needed.
See How to select the proper version of OpenCV Manager for details.

Note

Installation from Internet is the preferable way since OpenCV team may publish updated
versions of this packages on the Market.

samples folder contains sample applications projects and their prebuilt packages (APK).
Import them into Eclipse workspace (like described below) and browse the code to learn possible
ways of OpenCV use on Android.

doc folder contains various OpenCV documentation in PDF format.
It’s also available online at http://docs.opencv.org.

Note

The most recent docs (nightly build) are at http://docs.opencv.org/2.4.
Generally, it’s more up-to-date, but can refer to not-yet-released functionality.

Starting from version 2.4.3 OpenCV4Android SDK uses OpenCV Manager API for library
initialization. OpenCV Manager is an Android service based solution providing the following
benefits for OpenCV applications developers:

Compact apk-size, since all applications use the same binaries from Manager and do not store
native libs within themselves;

Hardware specific optimizations are automatically enabled on all supported platforms;

Automatic updates and bug fixes;

Trusted OpenCV library source. All packages with OpenCV are published on Google Play;

After clicking Finish button Eclipse will load all selected projects into workspace,
and you have to wait some time while it is building OpenCV samples. Just give a minute to
Eclipse to complete initialization.

Warning

After the initial import, on a non-Windows (Linux and Mac OS) operating system Eclipse
will still show build errors for applications with native C++ code. To resolve the
issues, please do the following:

At this point you should be able to build and run the samples. Keep in mind, that
face-detection and Tutorial2-MixedProcessing include some native code and
require Android NDK and NDK/CDT plugin for Eclipse to build working applications. If you haven’t
installed these tools, see the corresponding section of Introduction into Android Development.

Warning

Please consider that some samples use Android Java Camera API, which is accessible
with an AVD. But most of samples use OpenCV Native Camera which may not work with
an emulator.

Note

Recent Android SDK tools, revision 19+ can run ARM v7a OS images but they available not
for all Android versions.

Well, running samples from Eclipse is very simple:

Connect your device with adb tool from Android SDK or create an emulator with camera support.

Select project you want to start in Package Explorer and just press Ctrl+F11
or select option Run ‣ Run from the main menu, or click Run button on the toolbar.

Note

Android Emulator can take several minutes to start. So, please, be patient.

On the first run Eclipse will ask you about the running mode for your application:

Select the Android Application option and click OK button. Eclipse will install and run the sample.

Chances are that on the first launch you will not have the OpenCV Manager package installed.
In this case you will see the following message:

To get rid of the message you will need to install OpenCV Manager and the appropriate OpenCV binary pack.
Simply tap Yes if you have Google Play Market installed on your device/emulator. It will redirect you to the corresponding page on Google Play Market.

If using hardware device for testing/debugging, run the following command to learn
its CPU architecture:

adb shell getprop ro.product.cpu.abi

If you’re using an AVD emulator, go Window > AVD Manager to see the
list of availible devices. Click Edit in the context menu of the
selected device. In the window, which then pop-ups, find the CPU field.

Now, when you have your instance of OpenCV4Adroid SDK set up and configured,
you may want to proceed to using OpenCV in your own application.
You can learn how to do that in a separate Android Development with OpenCV tutorial.