We can use QT5 to write program for Android, especially the developer who ere not familiar with Android SDK or JAVA.
The people who are familiar with C language or Arduino can develop Android program easily.
This tutorial will show how to develop Android APK on pcDuino by QT5.
1. Set up the build environment.
Please refer to http://qt-project.org/wiki/Qt5ForAndroidBuilding to install QT and Android SDK.
2. Download and compile Arduino library under pcDuino Android system:
git clone https://github.com/liaods/c_enviroment_android.git cd c_enviroment_android/ ./build_for_android.sh
3. Use QT Creator to compile pcDuino’s examples.
Run qtcreator, select
==> Open File or Project
==> Android for arm (GCC4.7, Qt 5.1.1)
Build => Depoy All
After completing the above steps, you can get apk file. Path is:
Copy this apk to pcDuino and install. (In pcduino_qt_android-debug.apk which also includes a pre-compiled apk)
- Please do not choose gcc4.3, otherwise apk crashes. Author does not know why.
- c_enviroment (Sometimes also called Arduino library)for Ubuntu and Android is basically the same. Their small differences listed below:
Ubuntu version, main function is realized in libarduino, the called function does not need to write main. Just need some setup and loop.
Android version, the called function needs some main. Because if the main is realized in libarduino, qt do not call it (author does not know why).