Skip to content

Commit

Permalink
Merge pull request opencv#24700 from savuor:doc_android_win_fix
Browse files Browse the repository at this point in the history
Android Tutorial for Windows Updated opencv#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
  • Loading branch information
savuor authored Dec 15, 2023
1 parent 1cca4be commit ccc97b5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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***)
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ccc97b5

Please sign in to comment.