Download Template Project – Qt for Android (with OpenCV)

I start Qt for Android projects all the time and setting up all the required folders and including libraries can take some time, assuming that I don’t make any mistakes during the initialization of the project. Previously I had posted this about how to add OpenCV libraries to your Qt for Android project but it proved to be not enough and I also receive questions about how to create a correct project with OpenCV all the time.

So I decided to solve this problem once and for all. In this post I am sharing a ZIP file that you can download, extract and use as a template to create your own Qt projects for Android with OpenCV.



You can download the template from here.

Download

 

Everything is described using comments in the codes, files and folders after you extract the ZIP file. You obviously need to change some parts in it to fit your own needs.

If you have any questions, just put a comment below.



10 Replies to “Download Template Project – Qt for Android (with OpenCV)”

    1. Yes, thanks for mentioning this. You can find more cent tutorials in my website on the same topic.
      Or, just try lower NDK versions till you find the right one.

  1. Hi, Amin. I downloaded your example and OpenCV – 2.4.13.6 – android sdk
    from https://opencv.org/releases/page/2/ , changed paths in pro file and copyed opencv_java.so in android-sources folder. Got error on compiling step:

    error: undefined reference to ‘cv::imread(std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator > const&, int)’
    linker command failed with exit code 1 (use -v to see invocation)

    I use ndk 20.1.5948944 in Qt and idk what i’m doing wrong. Mby i must built my own opencv-sdk using ndk20b from here https://developer.android.com/ndk/downloads/older_releases?
    sry for bad english.

      1. Can u pls tell me what version of QT, ndk for QT and OpenCV from this site (https://opencv.org/releases/) you used to made this example working?
        I’ve been sorting through the options for a week and still haven’t earned anything on Android.

          1. I already tried to do it. It turned out to be built with opencv 4.0.1, but in Qt even with ndk16 these libraries did not work, an imread compilation error was issued.
            New qt versions were not built with any ndk. I got either an error in cmake, or at 63% of the build phase.

            Now, I just want to reproduce your settings to make sure that at least your option will work for me. Maybe you will add to the example that I can download above, your opencv libraries that you used. I could run this example in Qt without any configurations and make sure that my problem is in libraries and not in Qt settings.

            Your example is already running on my android device if I comment out lines with functions from opencv.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.