<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.linkinstruments.com/wiki/index.php?action=history&amp;feed=atom&amp;title=OpenCV_4_Android</id>
	<title>OpenCV 4 Android - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.linkinstruments.com/wiki/index.php?action=history&amp;feed=atom&amp;title=OpenCV_4_Android"/>
	<link rel="alternate" type="text/html" href="https://www.linkinstruments.com/wiki/index.php?title=OpenCV_4_Android&amp;action=history"/>
	<updated>2026-04-26T19:58:53Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.9</generator>
	<entry>
		<id>https://www.linkinstruments.com/wiki/index.php?title=OpenCV_4_Android&amp;diff=7&amp;oldid=prev</id>
		<title>173.54.17.33: Created page with &quot;== OpenCV – introduction to Android development ==  == Getting Started == This project assumes that you will be working within a Windows 7 or newer operating system.   == Se...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.linkinstruments.com/wiki/index.php?title=OpenCV_4_Android&amp;diff=7&amp;oldid=prev"/>
		<updated>2021-01-16T12:37:03Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== OpenCV – introduction to Android development ==  == Getting Started == This project assumes that you will be working within a Windows 7 or newer operating system.   == Se...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== OpenCV – introduction to Android development ==&lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
This project assumes that you will be working within a Windows 7 or newer operating system. &lt;br /&gt;
&lt;br /&gt;
== Setting up Android development environment ==&lt;br /&gt;
You must download the following:&lt;br /&gt;
&lt;br /&gt;
Java JDK (6 or newer) found here: &lt;br /&gt;
 http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html&lt;br /&gt;
&lt;br /&gt;
Android SDK Tools:&lt;br /&gt;
 https://developer.android.com/sdk/index.html#Other&lt;br /&gt;
&lt;br /&gt;
Android NDK:&lt;br /&gt;
 https://developer.android.com/ndk/downloads/index.html&lt;br /&gt;
&lt;br /&gt;
Eclipse Classic (version 4.2.2 Juno)&lt;br /&gt;
 http://www.eclipse.org/downloads/packages/eclipse-classic-422/junosr2&lt;br /&gt;
&lt;br /&gt;
OpenCV-3.0.0-android-sdk-1.zip (or the package of your choice):&lt;br /&gt;
 http://sourceforge.net/projects/opencvlibrary/files/opencv-android/&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
install '''Java JDK''' – install 32 or 64 bit depending on your operating system&lt;br /&gt;
*NOTE: one of the issues that may occur when installing Android SDK Tools on a 64 bit machine is that it may not detect the Java JDK. This anomally had occurred when installing Java JDK 7 (64 bit version). Should this issue arise, you must copy java.exe from &lt;br /&gt;
 C:\Windows\System32 &lt;br /&gt;
and paste it into the directory:&lt;br /&gt;
 C:\Windows\SysWOW64&lt;br /&gt;
&lt;br /&gt;
Install '''Android SDK''' - customize which version of Android you want to develop for (forwards compatible, so Android 2.3 will work for 5.0 but will be lacking features). 5.1 and M are chosen by default, you may uncheck them and choose another if your device is older. Leave the rest as default.&lt;br /&gt;
(Note: if you are getting access denied errors when attempting to download packages, run Android SDK manager as Adminstrator)&lt;br /&gt;
&lt;br /&gt;
Copy the self-extracting '''NDK compressed file''' and place it in the directory you prefer. Then proceed to run it.&lt;br /&gt;
&lt;br /&gt;
Extract '''Eclipse''' and '''OpenCV-android-sdk.zip''' to your location of preference&lt;br /&gt;
&lt;br /&gt;
== Setting up Eclipse ==&lt;br /&gt;
Install the '''Eclipse ADT plugin'''. To do this open Eclipse, in the top menu click HELP, then INSTALL NEW SOFTWARE, a new window should pop up, paste the location of the ADT plugin to be downloaded which is:&lt;br /&gt;
 https://dl-ssl.google.com/android/eclipse/&lt;br /&gt;
Hit ADD. Give it the name ADT. SELECT ALL and NEXT. NEXT again, ACCEPT and FINISH. It download automatically and will prompt to restart after done installing, click yes.&lt;br /&gt;
		&lt;br /&gt;
Set NDK path under WINDOW → PREFERENCES → ANDROID → NDK and point it to the root file directory where the NDK file is. Use double back slashes or single forward slashes (i.e. &amp;quot;X:\\Apps\\android-ndk-r8&amp;quot; or &amp;quot;/opt/android-ndk-r8&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Import openCV-android-sdk by right clicking inside the package explorer window, click IMPORT, under GENERAL click EXISTING PROJECTS INTO WORKSPACE. In select root directory hit BROWSE and select the file where you extracted the openCV-android-sdk file. Hit SELECT ALL and FINISH.&lt;br /&gt;
&lt;br /&gt;
Right click on the package manager of the eclispe screen and select IMPORT. You want to import an existing Android Project. When prompted, select the OpenCV4Android file containing the samples, sdk, apk etc.&lt;br /&gt;
&lt;br /&gt;
''Repeat the following steps for EACH file in the package explorer:''&lt;br /&gt;
Select a file under the package explorer.  Then create a new environment variable. Do this by:&lt;br /&gt;
right clicking PROPERTIES on package explorer → C++ build → Environment → add &amp;quot;NDKROOT&amp;quot; for name and the file path to the NDK root file. Once again, use double forward slashes or single back slashes instead of a single back slashes for the file path. Click REPLACE NATIVE ENVRONMENT WITH SPECIFIED ONE at the bottom. APPLY and OK.&lt;br /&gt;
&lt;br /&gt;
Under C/C++ Build, BUILDER SETTINGS TAB, uncheck USE DEFAULT BUILD COMMAND and type in “${NDKROOT}/ndk-build.cmd”&lt;br /&gt;
&lt;br /&gt;
Next, under the BEHAVIOR tab in the same window, uncheck CLEAN and check STOP ON FIRST BUILD ERROR and BUILD ON RESOURCE SAVE. Delete the “all” value within those fields.&lt;br /&gt;
&lt;br /&gt;
Lastly, on the left plane click ANDROID and for PROJECT BUILD TARGET check the android version you will be developing toward. &lt;br /&gt;
&lt;br /&gt;
After doing this for each file, restart Eclipse. Eclipse should now be properly configured and display no errors.&lt;br /&gt;
&lt;br /&gt;
== Setting up Android devices ==&lt;br /&gt;
Make sure the device is not connected to the computer yet.&lt;br /&gt;
&lt;br /&gt;
Assuming your device does not have a developer options tab unlocked already, go to your SETTINGS, ABOUT PHONE or ABOUT TABLET, and tap on the BUILD NUMBER or SW VERSION multiple times until it tells you “You are now a developer!”&lt;br /&gt;
&lt;br /&gt;
Now for device installation, you must set up adb, set up usb debugging by going under the DEVELOPER OPTIONS, check ANDROID DEBUGGING and USB DEBUGGING NOTIFY. &lt;br /&gt;
&lt;br /&gt;
Download adb drivers for the device must be downloaded. Disable mtp or ptp storage and have the device set to charge only mode. This is done differently on each device. For Cyanogenmod, go to SETTINGS, STORAGE, click on the 3 dot button on the right corner. Make sure MTP and PTP storage are unchecked. For the ZTE speed, go to SETTINGS, CONNECT TO PC, and check CHARGE ONLY.&lt;br /&gt;
&lt;br /&gt;
 Connect your device to your computer. It should automatically download the adb drivers. If not, first install the manufacture drivers for your device. A quick search on the web of the model and brand of device should be sufficient to find the drivers if they do not come up automatically from your device. Install these drivers, reconnect the device in CHARGE ONLY mode once again and adb drivers should install.&lt;br /&gt;
&lt;br /&gt;
When connecting your device to the computer you should now get a prompt asking, “Allow USB debugging?”. If it is your personal computer, check “Always allow from this computer” for convenience. Then click OK (WARNING: if you do not complete this step you will be unable to proceed further) &lt;br /&gt;
&lt;br /&gt;
Next you will need the OpenCV Manager app for your device. This can be obtained from within your OpenCV-Android-sdk folder. To install it, you will first need to do the following steps:&lt;br /&gt;
&lt;br /&gt;
1) Get cmd to recognize 'adb' as a command&lt;br /&gt;
	To do this, on your windows machine open CONTROL PANEL, click SYSTEM AND 	SECURITY, then SYSTEM, on the left click ADVANCED SYSTEM SETTINGS hit 	ENVIRONMENT VARIABLES. Hit NEW and add:&lt;br /&gt;
	&lt;br /&gt;
Variable name: &lt;br /&gt;
 ANDROID_PLATFORM_TOOLS&lt;br /&gt;
Variable Value: &lt;br /&gt;
 C:\Users\USERNAME\Downloads\adt-bundle-windows-x86_64\sdk\platform-tools&lt;br /&gt;
	&lt;br /&gt;
	click OK. Then NEW again and add:&lt;br /&gt;
&lt;br /&gt;
Variable name: &lt;br /&gt;
 ANDROID_TOOLS&lt;br /&gt;
Variable Value: &lt;br /&gt;
 C:\Users\USERNAME\Downloads\adt-bundle-windows-x86_64\sdk\tools&lt;br /&gt;
&lt;br /&gt;
	click OK. Then NEW again and add:&lt;br /&gt;
&lt;br /&gt;
Variable name: &lt;br /&gt;
 PATH&lt;br /&gt;
Variable Value: &lt;br /&gt;
 %Path%;%ANDROID_PLATFORM_TOOLS%;%ANDROID_TOOLS%&lt;br /&gt;
	&lt;br /&gt;
	click OK and OK on the environment variables windows and OK on system properties.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Now open up CMD in Windows and run as admin&lt;br /&gt;
&lt;br /&gt;
check your device is listed by typing:&lt;br /&gt;
 adb devices&lt;br /&gt;
&lt;br /&gt;
get the architecture of your device by typing:&lt;br /&gt;
 adb shell getprop ro.product.cpu.abi&lt;br /&gt;
&lt;br /&gt;
install the opencv manager from the directory location of the opencv file:&lt;br /&gt;
 adb install  c:\...\opencv-android-sdk\apk\OpenCV_3.0.0_Manager_3.00_(choose the one corresponding to your device's architecture).apk&lt;br /&gt;
&lt;br /&gt;
or for exmaple: &lt;br /&gt;
 adb shell getprop ro.product.cpu.abi gave: armeabi-v7a&lt;br /&gt;
&lt;br /&gt;
thus we will do:&lt;br /&gt;
 adb install C:\...\opencv-android-sdk\apk\armeabi-v7a.apk&lt;br /&gt;
&lt;br /&gt;
You now have installed the OpenCV library required on the android device.&lt;br /&gt;
&lt;br /&gt;
== Running the samples ==&lt;br /&gt;
Ensure your device is connected to your computer with the screen on and unlocked.&lt;br /&gt;
&lt;br /&gt;
In Eclispe, in the PACKAGE EXPLORER, right click a package and hit RUN AS → ANDROID APPLICATION. Now wait for it to load on your device.&lt;br /&gt;
&lt;br /&gt;
The package will be compiled as an .apk on the phone automatically and will create a new logo with the openCV icon. Repeat for each desired package.&lt;/div&gt;</summary>
		<author><name>173.54.17.33</name></author>
	</entry>
</feed>