Home Screen Technical Overview
This is the primary landing screen, providing a dynamic and responsive interface that adapts based on the user's authentication state and available remote devices.
Generally, this screen would always be the first screen a user sees when they open the Smarta Mobile app.
Key Functionalities
User Authentication & Navigation
-
Authentication Check:
- The screen verifies whether the user is logged in using the platform's authentication context.
- If a user is not authenticated, they are immediately redirected to the login page.
-
Dynamic Content Display:
- For authenticated users, the screen conditionally displays controls for remote water management devices.
When logged in and devices are available via Bluetooth scan - For non-authenticated users, a welcome message and introductory information about Smarta Mobile are presented.
When logged out
- For authenticated users, the screen conditionally displays controls for remote water management devices.
Remote Device Integration
- Device Data Retrieval:
- The screen fetches remote device settings from a Smarta backend using the user's stored authentication token.
- The data retrieval is performed through periodic polling (every 10 seconds) to ensure that the information on the screen is up to date.
- Device Interaction:
- When remote devices are available, each device is represented with an image and a corresponding interactive control.
- Tapping on a device control navigates the user to a dedicated screen of the selected device.
The dedicated device screen