Android SDK build script: HWAsan flags added for release mode #25746
A quick fix for #25718
### 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
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
Android SDK build script: HWAsan support added #25718
### 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
- [ ] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
Add component disable flag to android build #25190
Adding --disable flag to android sdk build script. The flag allows to exclude components from build by concatting -DWITH_XXX cmake flag to the build command. Example : --disable OPENEXR (uppercase).
- [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
- [ ] 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
Added kotlin classes to AAR #24884
The resulting maven repo doesn't have kotlin-plugin dependency, and it works fine out of the box: Android Kotlin projects already have kotlin-plugin dependency, Android Java projects ignore kotlin classes.
Details on KGP versions: https://kotlinlang.org/docs/gradle-configure-project.html#apply-the-plugin
### 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
- [ ] 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.
- [x] The feature is well documented and sample code can be built with the project CMake
Co-authored-by: Alexander Lyulkov <alexander.lyulkov@opencv.ai>
Co-authored-by: Alexander Smorkalov <alexander.smorkalov@xperience.ai>
Added offline option for Android builds #24956
### 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
- [ ] 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
Modified Java tests to run on Android #24910
To run the tests you need to:
1. Build OpenCV using Android pipeline. For example:
`cmake -DBUILD_TEST=ON -DANDROID=ON -DANDROID_ABI=arm64-v8a -DCMAKE_TOOLCHAIN_FILE=/usr/lib/android-sdk/ndk/25.1.8937393/build/cmake/android.toolchain.cmake -DANDROID_NDK=/usr/lib/android-sdk/ndk/25.1.8937393 -DANDROID_SDK=/usr/lib/android-sdk ../opencv`
`make`
2. Connect Android Phone
3. Run tests:
`cd android_tests`
`./gradlew tests_module:connectedAndroidTest`
Related CI pipeline: https://github.com/opencv/ci-gha-workflow/pull/138
### 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
- [ ] 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.
- [x] The feature is well documented and sample code can be built with the project CMake
Modified AAR script: added javadoc to Android Maven #24849
Modified AAR script.
Now the script creates 2 maven repos. The first repo contains sources jar, javadoc jar and AAR without cpp libraries.
The second repo contains modified AAR with cpp libraries. The script merges two repos into one.
### 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
- [ ] 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.
- [x] The feature is well documented and sample code can be built with the project CMake
Co-authored-by: Alexander Lyulkov <alexander.lyulkov@opencv.ai>
Co-authored-by: Alexander Smorkalov <alexander.smorkalov@xperience.ai>
- Added JavaDoc package build and publishing
- Added Source package build and publishing
- More metadata for publishing
- Disable native samples build with aar, because prefab is not complete yet
Android sample for VideoWriter #24592
This PR:
* adds an Android sample for video recording with MediaNDK and built-in MJPEG.
* adds a flag `--no_media_ndk` for `build_sdk.py` script to disable MediaNDK linkage.
### 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
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
- Use the same tools and plugins for SDK build and AAR build
- Added script to test Gradle-based samples against local maven repo
- Various local fixes and debug prints
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
Added scripts for creating an AAR package and a local Maven repository with OpenCV library #24456
Added scripts for creating an AAR package and a local Maven repository with OpenCV library.
The build_java_shared_aar.py script creates AAR with Java + C++ shared libraries.
The build_static_aar.py script creates AAR with static C++ libraries.
The scripts use an Android project template. The project is almost a default Android AAR library project with empty Java code and one empty C++ library. Only build.gradle.template and CMakeLists.txt.template files contain significant changes.
See README.md for more information.
Android NDK camera support
* Add native camera video backend for Android
* In the event of a "No buffer available error" wait for the appropriate callback and retry
* Fix stale context when creating a new AndroidCameraCapture
* Add property handling
* fixing #17572https://github.com/opencv/opencv/issues/17572 Build for Android failed: "can't concat str to bytes"
on Windows 10 64bit with python 3.6.6
* similar to changes in platforms/winpack_dldt/build_package.py