Create an app sharing to counting accesses

You will need blocks in the dataChanged event to change the position of the switch ? (Assuming you have sent information about the which state you want the switch to be in)

yes, i need to store and share to the others devices the state of the switch. I don't know how to send to cloudDB the Change information "When Switch.change" the position of the switch doesn't change on the others devices as instead the label does

Something like this:

i don’t understand: all this code to show the variation of the switch position to the others devices that runs the same application?

It is not that much more thatn the original app i wrote for you, just allows for the switch setting and text as well, and by using a list to store the data means we only have one tag to worry about on each data change.

ok, sorry but it's hard to understand every step so i were worried. i try and i respond you

OK, perhaps you haven’t explained how the switch is used in your app. All I did was programmatically change the switch based upon a user pressing the +/- buttons. If the user has to “turn the app” on, I am not sure why this is needed or how you intend this to work?

Here is the aia project that i prepared with the switch (as shown in the blocks) perhaps this will help, you seem to have got very confused…

cloudDBClicker2.aia (4.1 KB)

the switch is used only to show the associated phrase.
when switch1 is turned on, red text is shown. When switch1 is turned off, black text is shown. I can share the right text and color, but I cannot share the on / off status. Yes,sorry i used App inventor a few times so i'm very very very confused

Are you looking for these blocks, to turn the switch on and off from inside?
switch off switch on

i don’t know how to use this in my code…where and how to store this value in CloudDb to obtain the sharing between users… can you help me?thank you so much

i’ve tried some different combinations and this picture is the last one tried, but i’ve failed, can you correct my code?
thanks :frowning:

Please explain, in words, the reason for the switch? I thought it was just to show which button had last been pressed, but it seems that you want it to turn on and off the button functions. Please explain in detail this and the workflow for you app, then i am sure we can resolve the problems you are having. You should not need to have all those cloudDBs, just one will do it.

the reason of the switch element(The element is composed by a graphic part and a text part):
when switch is on the left =Off (element and Text are grey to
when switch is on the right=ON(element and a different Text are red)
I used the Switch to give an information to users that enter in the app:
if they see The switch ON=RedText they understand they mustn’t touch the display.
if They see the Switch OFF= GreyText they understand that they could play with the bottoms.
If on my smartphone i touch the Switch Element: change its Color/position/Text/ColorText, but on the other users’s displays change only Text/ColorText.
i just want send on all devices the entire Switch Element.
try to show you two screens at the same moment

But you want it so that only you can set the switch to on or off, and the other users can just see whether they can use the app or not (in fact you want to be able to disable the buttons)

If this is the case, you may need to have a “manager” app and a “user” app (this could be done in the same app with a password protected section).

Yes ?

no, i want anyone could switch on or off ...and that everyone could see this change in real time

if we are: Mary, John, Matt
i want that in the morning Mary switch on
and at the end of the day Matt switch off the app...and John in this case can observe the all variations

I developed on my cloudDBClicker example app. I believe this works as required

cloudDBClicker3.aia (5.0 KB)

oops, in screen1.Initialise, you may need to set the switch - valueifnotthere to OFF

EDIT - previous post now updated to handle this

thank you so much for your great great great help! the switch change on every devices (thanks also for code that enable the buttons)

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