In order to better show the project outcomes, an Android mobile application has been developed. The application allows its users to choose between different buildings, then, it will provide the user with real-time readings from the system sensors and modules. The application has been built using Android Studio which is open-source software that supports Java and Kotlin languages for android applications. In this project Java has been selected since it is widely used programming language and has much more supporting documents and community, also, it has a faster building process than Kotlin. The application consists mainly of a home page that has a list of tested buildings, a page for monitoring the sensors and camera readings. Within the application’s Java code, different classes and activities have been implemented. In addition, access to a database is required for reading data from it and writing to it. For testing and debugging the code, Android Studio emulator or real Android device can be used.
Android Studio Activities
Since the application has to do several tasks, each task or feature can be represented using something called activity, which is basically a Java class where the developer can describe the task, upload user interface (UI) elements and the needed Extensible Mark-up Language (XML) file for each activity.
- Home page Activity
Home page activity is designed to be the main activity for the user, where the application user can reach other activities from home page activity. This activity is linked to an XML file that has basically buttoned which are operated using the common method in android which is setOnClickListener().
- New Building Activity
New building activity allows users to add new buildings and create their profiles after clicking on add new building button using the name and address in the time of need to test them. - Building List Activity
Building list activity is for viewing and accessing the profiles for each building. Unlike the previous activity, this one is to read the data that has been stored in new building activity from firebase. The activity is linked to several XML files that include recycler view and card view. Both features in Android studio will help in updating the list when a user registers a new building. Furthermore, the activity needs another Java class to store any new values.
- Doha Tower Activity
Doha tower activity is mentioned here as an example and the same method will be applied for each tower mentioned in the list. In these activities, users will see sensors’ data that are retrieved from firebase in real-time. Moreover, feedback will be given to the user about the status of the drone, based on the Lidar sensors readings. It has been specified in the code that whenever at least one Lidar shows 1m distance as specified in the system constraints, the user will be notified about that. Also, there are buttons to activate Lepton 2.5 and Raspberry Pi camera.
To have an overview for activities and classes flowchart below
Firebase Database
Firebase is a free database provided by Google for mobile and web development, and it is used as the database for this project. Firebase is used to store the retrieved data from sensors, and it supports real-time and offline access for the database. Also, it provides low latency and security. Firebase allows storing and synchronizing data between users and real-time. In this project, whenever the data is changed either from sensors or users’ side, it is stored and updated directly in the cloud. Firebase data is formatted as JavaScript Object Notation (JSON).