In Machine Vision there is a magical trick that involves Fourier transformation of an image and I would like to share it with you today. I learned this long ago from a professor of mine but I remember back then there was not much experience and information about this on the web. Also there was no program that allowed experimenting with Fourier transformation of Images, until I developed an Android application titled Image Transformer, using OpenCV and Qt, which allows you to do just that.
How to set Android Screen Orientation in Qt
To be able to set your Android app orientation (to Portrait or Landscape mode) in Qt you have to modify AndroidManifest.XML manually. In this post I am going to describe where you can find this “AndroidManifest.XML”, because it does not exist in your project folder by default and how to modify it to set any desired Screen Orientation for your App.
Continue reading “How to set Android Screen Orientation in Qt”
How to get screen size in Qt
Qt includes a very simple method to get the size of the screen (width and height). Here it is:
QSize size = qApp->screens()[0]->size();
Note that this function works perfectly in Android and iOS too.
Another thing to note is that if you replace [0] with 1, 2, 3, … you can access other monitors (if there are any) on desktop computers.
How to Open Android Image Gallery in Qt
This article describes how to open default Android Gallery in Qt using a mixture of Android’ Java and Qt (C++) code. It is specially useful if you are working with images, for example if you want to open a Mat Image in OpenCV using imread function or if you are just writing some kind of image viewer program. Unfortunately Qt does not offer this (yet) by default so I thought I could share it with you.
Continue reading “How to Open Android Image Gallery in Qt”How To Mix C++ And Java Code (In Qt For Android)
Qt allows you to use Java code in your Android applications. This is the same code that Android Studio (or Eclipse etc.) users use when they are writing applications for Android. In Qt, by default, you are limited to C++ code and what the Qt modules have to offer (which in most cases are enough) but there are certain situations where you need to use something from Android API which is not provided in Qt. An obvious example for this can be using the default Android Galley to open a picture, or using Text-To-Speech engine or any other API that you can think of. If you don’t want to be limited to what is provided by Qt while writing Android apps then follow the steps below to be able to add Java code to your Qt project.
Continue reading “How To Mix C++ And Java Code (In Qt For Android)”My Google Developer Page
As of now my Google Developer page is also active. It can be called just a first draft anyway 🙂
You can reach it using the link below:
https://play.google.com/store/apps/dev?id=7993172462492044629
You can access all programs in my personal developer account from here. I’ll try to write more Android apps with Qt and OpenCV as soon as I get some more free time.
Image Transformer Website Up and Running
You can access Image Transformer website using this link.
From now on I’ll post all updates and announcements there.
You can still use CONTACT ME page on my personal website here to send your source-code requests.
Good luck!
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.
Continue reading “Download Template Project – Qt for Android (with OpenCV)”
How to Sign Your APK in Qt
If you want to upload an Android application into your Google Play Developer account then you have to sign your apps. Pictures below explain how you can do this in Qt.
How to add Permissions to your Qt Android app
Whether you want to use GPS or Compass, Camera or the Internet, you will need to add permissions to your Qt app for Android because Android API uses a permission system for security reasons. It actually has other benefits such as helping with monitoring and app statistics and so on but I’m not going to discus that in this post.
If you need to add permissions to your Qt Android app then follow these steps.
Continue reading “How to add Permissions to your Qt Android app”