Update Android OpenCL sample #24715
Update Android OpenCL sample and tutorial text.
### Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
- [x] I agree to contribute to the project under Apache 2 License.
- [x] 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
- [x] The PR is proposed to the proper branch
- [x] 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
Updated Android samples for modern Android studio. Added OpenCV from Maven support. #24473
Updated samples for recent Android studio:
- added namespace field that is required in build.gradle files
- replaced _switch_ by _if-else_ because it doesn't work with constants from resources
- added missed log library dependency in face-detection/jni/CMakeLists.txt
- use local.properties to define NDK location
Added support for OpenCV from Maven. Now you can choose 3 possible sources of OpenCV lib in settings.gradle: SDK path, local Maven repository, public Maven repository. (Creating Maven repository from SDK is added here #24456 )
There are differences in project configs for SDK and Maven versions:
- different dependencies in build.gradle
- different OpenCV library names in CMakeLists.txt
- SDK version requires OpenCV_DIR definition
Requires:
- https://github.com/opencv/ci-gha-workflow/pull/124
- https://github.com/opencv-infrastructure/opencv-gha-dockerfile/pull/26
Many of the Android samples rely on an options menu to work properly
but, at least on newer devices, the menu is permanently hidden by the
Android theme "Theme.NoTitleBar.Fullscreen", which means that most
of the examples were dysfunctional.
now it builds by the command:
`cmake.exe -Wno-dev -GNinja -DCMAKE_MAKE_PROGRAM="path\to\ninja\ninja.exe" -DCMAKE_TOOLCHAIN_FILE=../opencv3/platforms/android/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a with NEON" -DANDROID_SDK_TARGET=21 -DANDROID_NATIVE_API_LEVEL=14 -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DBUILD_ANDROID_EXAMPLES=ON -DINSTALL_ANDROID_EXAMPLES=ON -DWITH_OPENCL=YES -DANDROID_OPENCL_SDK=path\to\OpenCL ../opencv`