Skip to content

Data Synchronization

Kaustubh Patange edited this page May 18, 2022 · 32 revisions

Data synchronization

  • You must first install XClipper for Windows in order to continue!
  • In this guide we will learn how to synchronize desktop's clipboard data across mobile in XClipper.

?> Synchronization is purely based on the Firebase's Real-time database storage. Read why XClipper is not using Firestore instead, in this FAQ.

?> XClipper currently supports text-related data to be synchronized. To enable image synchronization, read this guide after completing the below steps.

!> There are some limitation to this feature in free version, read more.

<>

video-guide

<>

Steps

These are the steps we are going to follow, if you have any questions check the FAQs.

Creating your own data storage on Firebase

?> Firebase is a suite of tools provided by Google which makes a lot of things smoother, one of them is Real-time database. This is where all your clipboard data will be stored by the XClipper.

If you want to know why I don't host my own storage for this service, read this FAQ answer.

  • Go to firebase.google.com & click on "Go to console" button from the top right of the page (You might need to sign-in with your Google account).

  • Click on the "Add" project card, give your project a name & click continue.

  • There, disable "Enable Google Analytics" option & proceed to "Create project".

  • Once done you will see something like a dashboard screen.

  • Here click on "Realtime Database" > "Create database" > "Enable".
  • Now go to "Rules", update the text as shown above & then click on the "Publish" button.

Get all the required credential for setup

?> In these steps we will note down some of the credentials that you will need to connect your XClipper desktop application to the database.

I would recommend writing these information in a notepad file.

  • Go to "Realtime database" > "Data" & note the database location url as shown below.

<>

<>

  • This one is pretty complex to explain with single image so you need to watch the video given below. You will get "App Id" after following it.
**Client ID:**
323700069140-7hj54ukss3072gbr7in9627ti35o3mhs.apps.googleusercontent.com

<>

getting-started

<>

  • Click on "Gear icon" > "Project Settings" & note down the Web API Key as shown below.

<>

<>

Setting up the credential in the desktop app

?> In this step we will add the credentials in the XClipper application. I assume you were taking notes of them.

  • At the end, your notepad file should look like this (this may vary from yours).
Firebase Endpoint: https://test-project-9e017.firebaseio.com/

Firebase App Id: 1:1057025207873:android:c7004aea2af70512b220c0

Firebase API Key: AIzaSyC05g-9MkJbFhnxE2137MDeTT07wNHncfs
  • Now in the XClipper application from system tray, right-click > "Firebase configuration" & add those value. Click "Save" when done.

?> Note: If you need authentication & want to secure your database even more, check this guide.

Enabling required settings for sync

?> Here we will turn on the setting that will enable the syncing of the clipboard to the database.

  • In XClipper application from system tray, right-click > "Settings" & enable Database binding & Apply. If QR code is still not visible then Restart the application.
  • That's it now your clipboard item should be added to the database.

?> You can also enable Bind Deletion option which will delete items from your local storage if deleted from an online database (option is also available in Android client).

?> Tip: Hover on each item to see what they do.

Connecting mobile device to the storage

You first need to download the XClipper application on a mobile device.

  • In the app go to "Settings" > "Synchronization" > "Connect to database" & scan the QR code shown in the Settings window of XClipper desktop application.

?> Using this above approach you can connect as many device you want.

Sharing data with another PC

!> This can have some side effects, if you find them kindly report to me.

With this approach you can share the same database between multiple XClipper desktop application. This is useful if you want to share clipboard with your personal PC & work PC.

?> You need to purchase license for both system inorder for this to work.

  • In Right click > Firebase Configurations, there are two buttons at the bottom which can export & import the current Firebase configuration.
  • From one PC you've to export the configuration (which will save it in a file) & from other PC you just 've to import it.
  • Make sure you enter the database password which it will ask while importing. Your current password can be found in Settings.

Testing if clipboard data is syncing?

In most cases restarting the application solves the problem. But there might be a case if this does not work & you want to know if your clipboard data is properly syncing.

This can be used to determine the source of the problem. Is the desktop application not syncing properly or the mobile app not receiving it?

After all, it leads to this FAQs section.

  • You can check if the online database receives updates or not by going to firebase.google.com selecting your project which we created & going to the real-time database. It should update automatically when changes are made by XClipper. If this is not the case create a GitHub issue.
  • If your application is crashed or reported any issues. There is a log file that XClipper creates on every new instance located in %appdata%\XClipper\logs. You must upload the proper log file if you are reporting an issue.

Limitations

?> There are certain limitations imposed for free users. Unlocking premium will remove those as well as will encourage me to work on this project even more.

Feature Free Premium
Maximum number of clipboard data 10 120
Maximum length of text (characters) 1,000 10,000
Maximum number of connected Android device 1 10+
Securing data using encryption ✔️
Adding authentication (Google sign-in) ✔️

Why to encrypt database? Short answer: Since your database is public anyone can connect to your database and can read or make changes to it, read here.

If you want to know why these features are not unlimited for premium users, read here.

FAQs

Q. Database not updating / synchronization not working when enabled?

This could be due to various issues. Follow the steps to debug & apply solutions as required.

  • Go to firebase.google.com, select the project you've created & go to "Realtime Database" > "Data" > expand users list.
  • Now copy one item in the windows application & see if the data is updated on the website as well (see at 4:41 - 4:55 or 5:27 - 5:45).
  • If it updates then there is configuration issue with linking your Android device, so check again. Maybe logout & connect again.
  • If it does not update, then we've an issue.

First is to restart the XClipper windows instance through, Right Click > "Restart" & now check if the copy is updating the app on the website as well.

If this does not work, double check the configuration by following the video guide & see if you missed something in configuration or added some different value to configuration.

If nothing works contact me through Github issue or through the website's contact form.

Q. During connecting, signing in Android app does not work when "Authentication" is enabled?

Check if you've added the exact client key in the safelist client section in the Google Authentication tab as mentioned in Getting all required credentials for setup or watch this section of the video 2:10 - 2:47.

Also, in most cases it should display the error message for why the signing in Google account is not working. You can either create a Github issue or contact me through the website's contact form with the message.

Clone this wiki locally