2026-04-01 18:37:49 +05:30
|
|
|
# Water Level Sensor
|
|
|
|
|
|
2026-04-01 18:39:00 +05:30
|
|
|
Builds using QtCreator, use Qt Version 6.9.<br>
|
|
|
|
|
Builds for android and desktop.<br>
|
|
|
|
|
On Android Creates a service from service.cpp and android/src/org/qtproject/example/appwaterLevelSensor/WaterLevelService.java.<br>
|
|
|
|
|
Changes in AndroidManifest.xml are important.<br>
|
|
|
|
|
On Desktop just waits for values from a UDP Broadcast on local network with port 8176 and shows those values.<br>
|
2026-04-17 15:43:25 +05:30
|
|
|
On Android the service does that, and creates an alert notification if the value in broadcast is less than alert threshold.<br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
Create a new socket in Worker that will instantly start listening.<br>
|
|
|
|
|
In the service launch the threads and immediately send client hello to the worker socket.<br>
|
|
|
|
|
On client hello send command data to the android service.<br>
|
|
|
|
|
On quit send server bye to android service.<br>
|
|
|
|
|
On server bye deinit the sockets that send data to cpp server.<br>
|
|
|
|
|
On next launch, the command and client threads can be reinitialized from the StartService java class.<br>
|