Does someone want to help me (via teamviewer/discord) to make my app work?

description of the app I am trying to make:

  • normal screen is a map.
  • on the map there are markers
    => marker.fillcolor can either be
    -green (they have been clicked on/ been created in the last 7 days)
    -yellow (7-14 days)
    -orange(>14 days)
    -red (when clicked on a green marker it becomes red and vice versa)

these markers are loaded from a cloudDB

=> in the cloudDB :

  • tag = name of the marker
    value = list of 5 items (
    [1]name of the marker again;
    [2] latitude of the marker,
    [3] longitude of the marker;
    [4] status of the marker true/ false (which means it is green or red);
    [5] day of the year that it was last clicked on)

-When a user longclicks on a marker, it shows the name of the marker, and it changes the color to green; except if the color already was green, than it makes it red.
-Afterwards, it deletes the old tag in the cloudDB and stores a new one, with the same name, latitude and longitude, but with the updated status and day of the year.

This is the basis of the app, and I already made all of the blocks for this, but it doesn't work.

On top of this, there is a Admin option. (parts of this one are made, but others not)
To enter admin mode, you click on a button on the screen, a pop up box shows up with 'enter password'
if the password is correct, a global with 'administrator' becomes true and you enter admin mode.

In admin mode:
if you double click on the map:
you get a textbox with 'new name' and a button 'create new marker'
uppon clicking the button, he creates a new marker with the 'new name' he put in that textbox and the lat and long where he clicked, status = true and day of the year is the current day. and stores it in the CloudDB(first it checks if the textbox was not empty, and also he checks if the name doesnt exist already)

a second feature of admin mode is when an admin double clicks a marker,
he gets a notification 'do you want do delete ''name of the marker'' '
yes / no
and if he clicks yes, the marker is deleted from the cloudDB.

(i already made the thing to create new markers, but rest of admin mode is not made yet)

-however I tell I 'made' majority of the parts,
my app doesn't work, and I imeadiately get notifications to end the app when I open it because of 'bad arguments to select list item'

Is there someone that would want to take a look at my blocks I already have (together via team-viewer or discord or.. , and tell me the things I am doing wrong, and maybe help me fix them?
I have already read lots of documentation and similar projects but I haven't achieved any progression)

Thank you for reading my question and maybe help me think of a solution together!

here are my blocks as they are right now,
upon opening app, he checks the cloudDB

image
image

he checks every value of the cloudDB and checks how many days it has been since the last click on the marker
on not op that, he makes a list, this list contains all the values of the cloudDB

he creates the marker and puts it in the right color

further, this is how he changes the color when you longclick a marker.
first he updates the list with all the markers, changing the status of the marker and the day that we just clicked on

than he deletes the tag in the cloudDB, and stores a new tag, this time with the new status and day of the year

=> up until this part, I dont know if there are bugs in it or not, as I have not been able to test this bcs I am bugged before this :upside_down_face:

than this is the admin part that I already made:
right now, admin global is true (in future it has to be false up until password is given)
further, when clicked on the map, a textbox comes, and 2 buttons, become visible, and you either fill in the textbox and create a new marker, or you cancel it
image

the create new marker button first is checked if the textbox is filled in correctely (new, not empty name); if that is correct, it creates and stores a new marker in the cloudDB

the exact error I get is
Bad arguments to select list item

The operation select list item cannot accept the arguments: , ['com.google.appinventor.components.runtime.TextBox@cc826fb'],[1]

Welcome lola.

You may want to explain what the app is supposed to do. What appears to be a similar app is How to broadcast a GPS location and share the information on a map with others in real time..CloudDB
Reviewing the tutorial might help you if you have not previously seen it.

Some things to consider as you develop your app since

:

  • You have parts of the app that do not work and are attempting to 'fix' it. Have you tried building parts; get them to work, then put the pieces together? It is often easier to build a simple app that works, save a copy, then add the details.

  • You presently use a runtime Marker (the one with the Map1.CreateMarker). These types of Markers are difficult to hide/remove from your map. You might be able to use a designtime Marker (like Marker1) in your Project instead. Re-use it to display what you want. designtime Markers are easier to work with than runtime Markers.

  • I believe you should be storing geocoordinates (and its properties when displayed as a Marker) in a List and use the List to update the Marker location on the map and update the marker's properties that display when it is clicked instead of using a Procedure like create_marker.

  • saving posting dates. Don't save the yy/mm/dd information. Use the Clock and save the date as milliseconds; then use the app to convert the ms time to y/m/d or what ever format.

  • what you do depends on whether you have multiple users; need to display all the Markers on one map simultaneously (if you have multiple users) etc. You can have multiple users and display each user's data using a single design time marker.

Good luck with your Project.

thanks for the answer!
I am gonna start changing the markers to designtime markers and changing date format.
However, the problem with designtime markers is that you can't create new ones within the app. I already thought of just creating a ton of them, putting their names in a list, setting them all to invisible, and then when 'create marker' is triggered, it should select the first marker that is still invisible, and update it's location/...
However, the problem with this (that I couldn't solve), is how you get to do this call with the right marker
image
could I just iterate over the list with the markers? (to check their visibility and if false update the location/... )?
Like this:

However why I dont like this, is because in my app, I would probably need like 50 markers.

Answer to your question: I do want the same markers with the same information to be displayed to all the users.

geocoords, is this something different than latitude and longitude?

Good questions and concerns.

Get the information from a List; something like: user, hisLatitude,hisLongitude or hers. :slight_smile:

OK. All on the same map? Then you either need ~50 designtime Markers, some set to visible = true; others visible = false. You might use one designtime Marker that all users can access and allow any user to display whichever other location poster that is in a List of users. You set the Marker.SetLocation for the List of characters associated with the user.

geocoordinates is a way of saying use a pair of latitude degrees and longitude degrees. It can be something like latitude,longitude or a two element List of one latitude and one corresponding longitude.

Dinner time here. I will see if I can code a simple example and post tomorrow.

yes, so the idea is that everyone has the same map, and same markers,
and when someone changes a markers color,
everyone can see it

(and admins can create new markers or delete markers)

There are several ways to do something like that. Exactly how that happens depends on whether all the information is stored in the same CloudDB tag or each user's information is stored under individual Tags.

One way might be doing something like the attached example; another way might be by doing something like illustrated in this tutorial Social Distancing ... a CloudDB / Location Marker Tutorial . Exactly what is needed depends on how the information from each user is provided (by an administrator, by a LocationSensor on a user's device, from a GoogleSpreadsheet etc. You need to decide this.

Example:

The example (which shows how to work with Map, not how to implement using the CloudDB) might help you decide a method.
simpleMultiMarkers.aia (5.8 KB).
It shows three Markers. I am aware of a developer who used over 25 runtime markers successfully doing something similar; 50 might work. Start small.

Load the aia; then press #1, then 2 etc. to see how this simple app works.

Only admins? Then suitable code has to be written. A developer could modify data using Blocks alone or using a Googlespreadsheet - this can get very complicated.

Experiment and see what you can do.

If design time Markers are used in the map, it is not possible to create new markers or delete Markers using Blocks It is only possible to hide or show existing Markers.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.