Skip to content

RT DB Sample Applications

Christoph Schneider edited this page Mar 5, 2021 · 1 revision

1st Example: The Global String

The requirements for the first real-time database sample application are:

  • A string variable shall be synchronized globally over the internet;
  • All running apps shall be informed in case of changed string content;
  • Every single app can override the contents of the global variable

The source code of this application is located here: FB4D/Samples/RTDB_SimpleReadWrite. This example does not need user authentication.

As a precondition, you need to prepare the rules for access to the Realtime Database for your Firebase Project within the Firebase Console.

{"rules": {"Message": {".read": true,".write": true}}}

If you like to see how this application was built, check this video (build our first real-time database application). The next video shows how this application works: video to test the application.

2nd Example: One String for each Registered User

Advanced requirements compared to the first example:

  • When the application starts, each user logs in with an email and password using the self-registration workflow.
  • A separate string variable shall be stored for each user.
  • Each user can operate several applications in parallel.

The source code of this application is located here: FB4D/Samples/RTDB_PerUserReadWrite. It contains a user authentication to write data into the Real-Time Database, depending on the logged-in user.

More information is provided in this video to build the application.

3rd Example: The Cross-Platform Clipboard

This is a first real application to transfer the clipboard between PC, Mac, and Android or iOS mobile applications. In comparison to the second example, the string is replaced by a JSON object that contains the data type and the contents of the clipboard.

The next video shows how this application works:
Video to test the cloud clipboard application

Clone this wiki locally