Need help using the CloudDB (with a LocationSensor)

Hello, i’m pretty new here, i’m trying to use the CloudDB to store userID/status/latitude/longitude when reading it back it should allow to see in a map the position of those close to the user. But when i try to retrieve the data from the database i have no effects, is there any way to see what’s stored in database? The app should allow to track the COVID19 based on status infected/non cheched/clear that are moving around the user. It’s maybe way too simple and thrustworking but it’s a first step.

Please provide a more detailed explanation of what you are trying to achieve,
what you have done so far, what works, what doesn’t work…

Please show your relevant blocks,
if relevant, your data or lists,
screenshots of the Designer screen or app in action,
so we can see what you are trying to do…

Right Click in Blocks Editor and select “Download Blocks as Image”
for the best image of your blocks.

This is the second screen of my project, i want to achieve a database where is stored the phone number (used as id) the status of health (positive/negative/unchecked) and the coordinates to make a pointer display in the map, if the other users are closer than 0.02 to the user the pointer is displayed (negative ones don’t need to be displayed) so when someone walks around can know if there are unchecked or positive ones close by. Actually i’m trying to display just another pointer to check if the code works or not.

You have multiple issues Ayrin.

is a huge issue. 0.02 meters? The GPS can only at best resolve to about two meters. See Using the Location Sensor Read about a GPS receiver works. Especially read about the property called Accuracy and learn why the device often does not know where it is closer than 50 meters. These things prevent your app from determining whether other users are closer than 0.02 meters with any real precision.

So far, you do not have any obvious code showing how you determine how far two locations are from one another. There are several ways to do that.

Now, back to the CloudDB ... you store your values as a string status\latitude\longitude. OK. Where do you use the ClougDB1.GetValue Block to retrieve the contents of the ID Tag? You need that to "But when i try to retrieve the data from the database i have no effects" ... I don't see where you are 'retrieving' data Ayrin.

You still can make an interesting app. Just temper your expectations.

I would do this in several parts. Make separate Projects to learn CloudDB skills and also do the tutorials related to the LocationSensor. Then, put them together.


No, 0,02 is referred to the number given by the location sensor (ex. 12,183242), i didn’t do the distance check yet since i’m using 2 phones just to check if one can see other tag, uhm…ok since the issue is in retrieving data i will check tutorials. Thanks for the pointer @SteveJG

OK. Thanks for the clarification. 0.02 degrees of latitude extrapolates to 1574 meters at 45 deg. latitude or about 1.5 kilometers.

Then i guess it’s 0,002 :stuck_out_tongue:

Sorry to ask this, but if i use when.cloudDB.dataChanged it fire an event with the tag changed, it doesn’t work for all the tag in database? if not i have to get a taglist and make a from 1 to x cycle to retrieve all the database? if yes how do i get the database length? Sorry but i can’t find any tutorial for this. There is a way to visualize all the database to check if it works properly? Thanks.

seems the when.cloudDB.gotValue isn’t fired from call.cloudDb.getValue any idea what i’m doing wrong?

part of the problem is

what is returned from TagList (value) is a List. Your variable code must be a List; so set code to emptylist when you initialize it.

Yes you have multiple other issues you will have to debug.