salhanyf / iSeat-COEN390

Team project - Android app that uses a sensor.
3 stars 1 forks source link

AddSensor Diaglog Fragment Done. #41

Closed SamsonKaller closed 1 year ago

SamsonKaller commented 1 year ago

Dialog fragment for adding a sensor is complete.

Clone a new copy of the branch if you want to test. 1- copy-replace "google-services.json" with your own firebase google-services file to test.

2- Setup Firebase DB to look like this for testing: image (sorry for crappy writing, my pen was bugging)

at the root is a json object with key = "sensors" afterwards is a list of sensors, represented by their wifi module MAC address as Key. the sensor are json objects, each with a roomID (Number/integer) and status (boolean)

3-After adding the Firebase "google-services.json" file and creating some dummy data for the Firebase, you can test in the app, and changes u make directly on firebase are reflected on the android app.

** EDIT: I forgot there should also be a room entry for testing:

image

A. Copy-paste the following json structure into a notepad file. B. Save as .json file. C. Go to testing Firebase and click "Import JSON" for Realtime database

{ "rooms": [ null, { "location": "Hall Building", "name": "H-322" }, { "location": "FB-393", "name": "Fauxbourg Building" } ], "sensors": { "11:22:33:44:55:66": { "roomID": 0, "status": true }, "88:191:37:155:245:12": { "roomID": 0, "status": true } } }