Adam
Adam

Reputation: 91

Collaborative Button using google Drive Realtime Api

i'm new to the realtime api and i want to implement a trivial test project that will help me understand the structure of the api. Sorry if my question sound stupid but i don't think i really understand how to use the api.

What i want to do is create a button and when you press the button on the one app the same button will be pressed on the other apps. What i would like to know is how to model this button in the collaborative data model.

Could i use variables like isPressed or isRollOver to pass the buttons state or i can create a hole button object somehow?

i want to use java or javascript.

thank you!

Upvotes: 0

Views: 64

Answers (1)

Cheryl Simon
Cheryl Simon

Reputation: 46844

The realtime data model can consists of a combination of CollaborativeMap, CollaborativeList, CollaborativeString, and primitive javascript types.

I think for your use case you'd probably want a CollaborativeMap where you map a button name to a boolean value. You can then add an event listener to the CollaborativeMap to find out when the button's value changes.

Upvotes: 0

Related Questions