Mobile applications
NXP IoT –Weather Station Developer Guide
NXP Semiconductors PRELIMINARY 5
Figure 4. Mobile applications architecture
In order to have a consistent structure for the Android and iOS source codes, the packages structure in
both applications should be the following:
- Presentation: This package contains the files related to the UI, i.e., Activities (Android) and View
Controllers (iOS).
- Business Logic: This package contains the files related to the application logic: BLE connectivity,
Internet connectivity, JSON generation, Data validation, etc.
- Data model: This package contains the files related to the data model, i.e., Device class or
Measurement class.
- Persistent: This package will contain the files related to the persistent data storage, i.e., shared
preferences (Android), UserDefaults (iOS).
Implementation of the main functional blocks
For the sake of a clear structure and a practical use of the present document, we will analyze the
applications code from a functional point of view. This way, we will address the operations that should
be interesting for a developer willing to implement an application to obtain data from the RapidIoT
device and use it in a backend system.
2.3.1. Connecting to the RapidIoT
RapidIoT BLE configuration
The RapidIoT BLE interface is configured to provide the user with a set of BLE services and
characteristics to ease access to the information retrieved from the sensors integrated in the device.
Each sensor in the device has its own BLE characteristic where the microcontroller posts the
information, so the user can filter the information he will be notified about.