-
Notifications
You must be signed in to change notification settings - Fork 3
Android Application
To provide user control over specific parameters and settings that are of the user's preference, it is necessary to include an external application that configures the system appropriately. This may be required if the user wants to mix the brightness levels to produce a more optimum ratio or configure the wavelengths for nurturing their plant. The application communicates with the Raspberry Pi over a local network, manually overriding the PID control when the user creates parameter changes. Currently the parameters that can be set by the user are; Visible LED brightness, UV LED brightness, IR LED brightness and colour temperature. The application responds in realtime to the users interactions, with the PI implementing these instructions at a similar rate given a quality connection to the network. The GUI operates at a refresh rate of between 24-60fps, which is the Android application standard of operation. The widgets are arranged to clearly indicate the automateable parameters to the user. The application also comes with a bright and vibrant colour scheme and slick and intuitive user experience.
The Android app is developed using the QT framework in order to allow cross compatibility between mobile operating systems and high level access to the networking protocols. The particular protocol used for this system is a Transmission Controlled Protocol (TCP), and is server-client based. The QT framework is written in C++ which allows for a low level approach to developing mobile applications. The traditional approach to mobile application development is to use the Android Studio IDE or XCode and develop using Java or Swift but this limits the application to either being developed for Android or IOS and is not cross platform. QT being a cross-platform framework rectifies this issue and allows for development using one language however the correct dependancies for each platform must be included. For this mobile application the Android SDK and JDK were integrated into the QT Creator project to allow building for Android. The high level networking API provided by QT is set up to use QT signal and slot methods to intuitively pass around data from user-interface events.
The graphical user interface was created using QT Creator and is contained within a QML file for the project. QML is a mark-up language for QT that makes it easy to compose a Graphical User Interface for your application. This can then be accessed from the C++ main file to communicate between front-end and back-end elements in the application. In this case it is used to send slider and button events through the TCP network connection to the server on the RaspberryPi. The Slider and Button widgets were positioned using the QT Creator editor and their parameter limitations set inside the QML file. An IP address text input is also included in the design to allow the user to connect to the RaspberryPi for different wifi networks.
The finished GUI is shown below:
- Download APK from the MobileAppSoftware directory
- Make sure APK is moved to Android device
- Install APK and make sure "download from unknown sources" is enabled in settings
- The app should now be installed and an icon visible on the home-screen
- To use the app, tap on the icon to launch the program