From ccc97b5c46a6b73aa67ad3cf5239ede08123a0d9 Mon Sep 17 00:00:00 2001 From: Rostislav Vasilikhin Date: Fri, 15 Dec 2023 16:07:06 +0100 Subject: [PATCH] Merge pull request #24700 from savuor:doc_android_win_fix Android Tutorial for Windows Updated #24700 This PR updates Android tutorials parts related to Windows ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [ ] I agree to contribute to the project under Apache 2 License. - [ ] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [ ] The PR is proposed to the proper branch - [ ] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake --- .../android_dev_intro.markdown | 25 +++++++++++-------- .../dev_with_OCV_on_Android.markdown | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/doc/tutorials/introduction/android_binary_package/android_dev_intro.markdown b/doc/tutorials/introduction/android_binary_package/android_dev_intro.markdown index c82efb709a8b..ce247279fdb3 100644 --- a/doc/tutorials/introduction/android_binary_package/android_dev_intro.markdown +++ b/doc/tutorials/introduction/android_binary_package/android_dev_intro.markdown @@ -9,12 +9,8 @@ Introduction into Android Development {#tutorial_android_dev_intro} | Original author | Rostislav Vasilikhin | | Compatibility | OpenCV >= 4.0 | -@warning -Windows- and MacOS-related sections of this tutorial are outdated and should be updated - This guide was designed to help you in learning Android development basics and setting up your -working environment quickly. It was tested on Ubuntu 22.04, the sections related to other OSes -were not updated for a long time and should be considered deprecated. +working environment quickly. It was tested with Ubuntu 22.04 and Windows 10. If you encounter any error after thoroughly following these steps, feel free to contact us via OpenCV [Forum](https://forum.opencv.org). We'll do our best to help you out. @@ -51,11 +47,14 @@ In this tutorial we're gonna use an official Android Studio IDE and a set of oth Here's how to get a ready to work environment: 1. Download and install Android Studio: - 1. Download Android Studio: https://developer.android.com/studio - 2. Extract the tar.gz archive - 3. Follow the instructions in `Install-Linux-tar.txt`: open `android-studio/bin` folder in terminal and run `./studio.sh` - 4. Perform standard installation through GUI - 5. Optionally you can add a shortcut on a desktop for a quick access by clicking menu ***Tools -> Create desktop entry***. The menu appears after any project is created or opened. + * Ubuntu: + 1. Download Android Studio: https://developer.android.com/studio + 2. Extract the tar.gz archive + 3. Follow the instructions in `Install-Linux-tar.txt`: open `android-studio/bin` folder in terminal and run `./studio.sh` + 4. Perform standard installation through GUI + 5. Optionally you can add a shortcut on a desktop for a quick access by clicking menu ***Tools -> Create desktop entry***. The menu appears after any project is created or opened. + * Windows: + Just download Android Studio from the official site and run installer. 2. Install fresh Android SDK and NDK: 1. Open SDK manager in Android Studio (***Customize -> All Settings -> Languages & Frameworks -> Android SDK***) @@ -83,10 +82,14 @@ or [SourceForge](https://sourceforge.net/projects/opencvlibrary/). Setup Device for Testing and Debugging -------------------------------------- -Usually the recipe above works as expected, but in some cases there are additional actions that must be performed. In this section we'll cover some cases. +Usually the recipe above works as expected, but in some cases there are additional actions that must +be performed. In this section we'll cover some cases. #### Windows host computer +If you have Windows 10 or higher then you don't have to do additional actions to connect +a phone and run samples on it. However, earlier Windows versions require a longer procedure: + -# Enable USB debugging on the Android device (via Settings menu). -# Attach the Android device to your PC with a USB cable. -# Go to Start Menu and **right-click** on Computer. Select Manage in the context menu. You may be diff --git a/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.markdown b/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.markdown index 24fc79949c34..68d7ab36441c 100644 --- a/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.markdown +++ b/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.markdown @@ -40,7 +40,7 @@ In addition to this instruction you can use some video guide, for example [this 2. Setup the project: - Choose ***Java*** language - Choose ***Groovy DSL*** build configuration language - - Choose ***Minumum SDK*** to the same version number as was used during OpenCV 4 Android build + - Choose ***Minumum SDK*** with the version number not less than was used during OpenCV 4 Android build - If you don't know it, you can find it in file `OpenCV-android-sdk/sdk/build.gradle` at `android -> defaultConfig -> minSdkVersion` ![](images/setup_project.png)