Social Distancing ... a CloudDB / Location Marker Tutorial

@SteveJG clever stuff :slight_smile:

Won’t I be able to see these people at 2m (recommended distance) and take avoiding action - would be better to be eyes up rather than eyes down ? Anyway, we are not supposed to be out and about anyway :wink:

vi como pusiste el comentario en hace unos seegundos :open_mouth:

esta bien interesante

The project is interesting
But the accuracy of a smartphone gps is not high enough to be used to understand if a distance of a few meters has been maintained or not
From my experience with different phone models, the accuracy of the detected position varies from + -1-2mt to + -30mt
This, remaining outdoors, but entering any building the GPS signal is lost or reflected, generating even greater inaccuracies

Correct and a point made in the tutorial. have fun with the app to keep track of your family circle’s whereabouts. and comments elsewhere in the text. The larger issue is the GPS Accuracy varies between 2 and 50 meters depending on the quality of the satellite fix as described in Using the Location Sensor which creates more uncertainty about actual, precise locations than the quality of the GPS receivers in Android phones (except for some of the latest high end models).

'Better' location information can be obtained (using the AdvancedLocationSensor extension). The tutorial explains what is possible. Congratulations, you got one point of the tutorial.

The tutorial is more about how developers can use the CloudDB to share real time information - a CloudDB Location Marker Tutorial.

3 posts were split to a new topic: How do I use my own Redis server with a CloudDB projectd

Duplicate post again! You already have a topic on your problem. please do not double post

allí se estanca
¿algo esta mal?



When do you see this message "Progress bar

Connecting to the database

Loading saved maps and chats
Please wait " ?

When the tutorial was first posted, the app
Social Distancing was tested on a 7" Android 4.2.2 tablet, a 10" Android 8.1 tablet and two different Android 4.2.2 cell phones using both WIFI and a 4G network. Sometimes there are small issues using the 4G network; probably due to the small amount of memory in these older Android versions.

Since the tutorial has been first posted it has worked on Android 11, 12 and 13 without any issues.

I expect the app might be having issues on phones lower than Android 8.1. since MIT has changed the Companion or you are testing without a good WIFI or data Internet connection. A good WIFI/data is necessary to display the map.

Your error label is covering up your location. It appears that your device is not establishing a satellite fix; I guess the LocationSensor believes your location is 0,0 (its default location in the Atlantic Ocean' . You might test the app outside where your gps receiver has a clear view of the sky so that the app can get a satellite fix.

Did you change the app in any way?

I don't see the error messages on my device. :astonished:

si estoy con 4g
mi wifi no tiene problemas
estoy con android 9
al comapanion 2.66
y ahun asi no arranca
e esperado mas de 20 min nada
o tendra algo que ver con el token del CloudDB1


  • y ahun asi no arranca
    based on what you already showed, your gps is not providing a LocationChanged event

  • e esperado mas de 20 min nada
    you have lots of patience, if it doesn't work in 60 seconds, it probably will never work :cry:

  • o tendra algo que ver con el token del CloudDB1
    when you load the aia, the token is automatically set for your Project. :slight_smile:

Why is the app not working for you but works for others?
I do not know. The problem might be an issue with Android 9 or something else. To help find out, load this Project SimpleGPSTest2.aia (4.8 KB) . Then run the aia using Companion. Provide a screen capture of what the app screen shows. Thank you.

solo cambia el encabezado de
LocationSensor Testor

SimpleGPSTest2.aia works fine.

SocialDistance.aia this error on start.

@Juan_Antonio I am investigating. Thanks for confirming an issue. Error seems to be due to recent changes in app inventor. :cry:

SocialDistancing_2 has replaced the example SocialDistancing app aia to address issues caused by Google's security changes:

  • Request Permission FineLocation was added to automatically set the permission for the compiled app on Android 12+ as required by Google's latest security requirements
  • fixes error messages on some Android versions
  • fixes minor bugs
  • When using the example aia for the first time, the app now provides temporary, initial Marker locations for all all four example Users. These will be used as place holders until Mom, Dad, Son, Daughter user information is updated with a 'real' location.

The revised aia is now part of the tutorial. :astonished: Thanks for testing @Juan_Antonio .

@elmachi130 please try again using the revised aia.

-- Steve

@elmachi130 @Lofoli_Tomeseleke @Juan_Antonio the original project aia was updated and now should work for you if you load the SocialDistancing_2 aia. Thanks for your reports.

1 Like

me sale esto ya espere el tiempo indicado y se queda allí nomas
a quien mas le sale eso?


Try again outdoors SimpleGPSTest2.aia (4.8 KB) .

ya lo intente solo obtengo el proveedor gps en el encabezado

nunca e tenido problemas con el gps en otras aplicaciones

You never had problems with the gps in other applications. App Inventor apps?
Did you go outside and test?
Did you press the Test Now and wait up to a minute?
Did you ever use an app that used only gps to find your location?

Sorry you are still having issues. Others can use both the Social Distancing app and the test app and get good results. The question is why you are having issues and no one else.

The results you shared when running the SimpleGPSTest2 aia indicate your device might have an issue. Your LocationSensor on your device never gets a satellite fix.
Here are several possible reasons:

  • you are having issues with your gps hardware
  • you are testing in a building and cannot get a gps signal (go outside)
  • you live in an area of high mountains or in a city location with tall buildings. The gps receiver needs to have an unobscured view of at least 4 satellites.
  • your system settings on the device for Location is turned off. You can use the SimpleGPSTest to set the system Location on. or you can Navigate to Settings > Location > using your device settings and make sure Location is ON. Navigate to Settings > Location > Sources Mode and tap High Accuracy. NOTE: GPS accuracy varies depending on the number of visible GPS satellites. Locating all visible satellites can take several minutes, with accuracy gradually increasing over time.
  • To minimize battery usage, the Android system automatically disables some features such as the GPS when the power is low or battery saving mode is turned on. To be able to use your GPS effectively again, turning off battery saver could help you out.
  • your WIFI is out of range and your data connection is not enabled when attempting the SocialDistancing app The app requires an Internet connection for both the Map and the CloudDB. This is not the case when using the test app.

If you run the SimpleGPSTest2 and it does not work to display location coordinates, then SocialDistancing_2 will not work either. Something is wrong

Sorry, but you do now. Do you have another phone you can test with? If so what happens?

ya logre obtener la ubicación saliendo a la calle usando el wifi

ejecute el al companiom desde mi pc y con el wifi y emule al companiom en mi teléfono móvil y llegue hasta la calle y me sale los puntos marker hasta allí todo bien
pero doy unas pasos mas allá y el wifi ya no llega

trate de instalarlo como apk para utilizar mi paquete de datos y me sale esto que no se puede descargar

allí hay un problema
si se quiere que corra el app tiene que ser instalado con el apk para ejecutarlo con el paquete de datos
¿como podría corregir eso?

ya lo intente varias veces