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
File
==> Open File or Project
==> c_enviroment_android/qt_android_test/pcduino_qt_android.pro
choose
==> Android for arm (GCC4.7, Qt 5.1.1)
Build => Depoy All
After completing the above steps, you can get apk file. Path is:
./c_enviroment_android/qt_android_test/android/bin/Pcduino_qt_android-debug.apk
Copy this apk to pcDuino and install. (In pcduino_qt_android-debug.apk which also includes a pre-compiled apk)
Note:
- 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).
Leave a Reply
You must be logged in to post a comment.