Tutorial - Remotely Sync HanDBase for Android with Computer

Discuss plans for a future version of HanDBase for the Google Android platform

Tutorial - Remotely Sync HanDBase for Android with Computer

Postby DavidDevaneyJr » Mon Mar 02, 2015 4:39 am

Using the steps in this Tutorial I have been able to successfully synchronize HanDBase for Android with my Windows Computer remotely using Dropbox and Google Drive. This set-up enables a record level sync, as opposed to a file level sync using just Dropbox or Google Drive through FolderSync, or some other sync solution. This allows you to edit or add individual records on your Android device and on your desktop or laptop computer simultaneously. This should also work with most other Cloud Storage apps for Android, assuming there is a way to Synchronize folders to their cloud storage but YMMV (Your Mileage May Vary). Please test this first on your end before implementing this on a regular basis, especially if you use a Cloud Storage system other than Dropbox or Google Drive.

If you want to Sync your HanDBase databases with your Desktop or Laptop computer remotely take a look at this tutorial. Following the steps in this Tutorial will allow you to remotely sync your HanDBase database files with your home or business computer while away. To see this tutorial please visit my blog.

http://www.lorddewi.com/2015/03/02/tuto ... gle-drive/

DISCLAIMER: This sync method solution is not endorsed by DDH Software or any of it's employees. This Tutorial has been written by a Former employee of DDH Software who is now just a Fan of HanDBase. If you decide to proceed with setting up and implementing this solution you do so at your own risk. It is recommended that you backup your databases prior to syncing until you are sure it is functioning as described and desired. Please DO NOT contact DDH Software support to resolve any issues arising from use of this solution. The support staff at DDH Software will not be able to help you with any problems you encounter. You can post questions or comments to this DDH Software Forum thread but please don't ask DDH Software employees to help with setup or to solve any problems that might arise from use of this solution.
Regards,
David Devaney, Jr.
DavidDevaneyJr
 
Posts: 134
Joined: Tue May 19, 2009 11:01 pm
Location: Lake Worth, FL

Re: Tutorial - Remotely Sync HanDBase for Android with Compu

Postby Gab-Hop » Tue Mar 03, 2015 3:58 am

Hello
Thanks for your time
I have read your post as I am very interested in this topic
Just one question
Is this currently the best way to sync multiple android phones from different users to the same set of DB's on a record level sync if they don't have access to the desktop.
Will this method work for them?
I have tryed using hotkeys to sync to the desktop but came against problems.
Firstly I had to assign a static ip to each device and then put that address into the ahc file for each user
I got as far as making a one button sync for each user via autohotkeys, but haven't been able to activate this from the device because the handbase sync button on the device seems to take precedence over any form of remote access to the pc.
Thanks Gabriel H
Gab-Hop
 
Posts: 45
Joined: Mon Jan 13, 2014 11:34 pm
Location: New Zealand

Re: Tutorial - Remotely Sync HanDBase for Android with Compu

Postby DavidDevaneyJr » Tue Mar 03, 2015 5:45 am

After completing this Tutorial I decided to take it a little further. I saw some posts on the DDH Software forum from users who couldn’t or didn’t want to use Cloud Storage. Since FolderSync supports FTP also, I started to set up this type of sync as well. I’m in the testing phase for this and I will be posting another tutorial specific to FTP syncing since there are some things that are more specific to this. I’ll also include instructions on setting up your own FTP server.

In addition, I figured out a way to use AutoHotKey to automatically select the user in the HanDBase Conduit, rather than requiring it be the first user in the list. This should also allow remote syncing for multiple users to the same computer. I'm finishing the testing of this and I will post an update on my website when I've finished the testing and updating of that section of the Tutorial. I'll post a new link here when that's ready.

As for your question Gabriel H, what I just wrote above I'd actually written before seeing your reply to this post. Theoretically it will be possible to sync multiple computers to the same computer remotely. It will require a bit of additional setup with Dropbox or Google Drive, you'd need to setup a folder in the Dropbox or Google Drive folder for each user and have them sync to that specific folder instead of just a HanDBase folder in the main Dropbox or Google Drive folder. You will also need to do additional setup with the substr command, this section of the tutorial - http://www.lorddewi.com/2015/03/02/tuto ... e-drive/5/ - as you'll need to be able to Map each user's folder as a separate drive for the HanDBase Conduit setup to work. Then of course you'll have to set up a Shared HanDBase Sync folder on the computer, like you would anyway when you Customize the sync for multiple users in the Edit Sync Settings screen of the Conduit, where you can Share Databases. You will want to wait until I post the update to the Tutorial I mention above as that will enable the Script to pick the correct user to sync. I should have this up in the next day or so, I'm just putting the finishing touches on the post for my website.

So it is theoretically possible to use this solution to sync multiple users to the same computer remotely. I have not tested this extensively though so if you attempt it you'll want to do so with sample data until you are sure it's working to your satisfaction. Additionally, you won't have to worry about assigning static IPs as the sync from the device to the computer is done though Dropbox or Google Drive, whether done over the local network or remotely from out in the field. There are of course a few extra steps required, as opposed to just doing the sync within the HanDBase app, and the steps to do it must be done in a particular order, with a waiting period between some. So there is more of a chance of User Error with this solution. You may need to provide the users with a checklist of the steps to try to avoid that issue.
Regards,
David Devaney, Jr.
DavidDevaneyJr
 
Posts: 134
Joined: Tue May 19, 2009 11:01 pm
Location: Lake Worth, FL

Re: Tutorial - Remotely Sync HanDBase for Android with Compu

Postby kronhead » Tue Mar 03, 2015 12:37 pm

I am just using standard Handbase sync between my phone and my computer, but I just wanted to post a few comments about this.

I am impressed at the creativity people are demonstrating to solve a business need. I just worry that you are creating a complex infrastructure that will occasionally result in file damage and loss of data. Here's an example of my concern: cloud sync is not instantaneous. It must move from one device, to the cloud, and then down to the other device. I realize I am stating the obvious. But phones or tablets lose connectivity all the time. People get interrupted in their work flow by a phone call or a text message. Also, you need to make sure that the phone user stops updates long enough for an up and down cloud sync, the PC based Handbase sync, and then another up and down cloud sync. Now, if the work process supports all of this, great - but I worry that people will decide to do an update on the phone, just when the PC based sync is happening, or something like that. If you can either a) be careful enough EVERY TIME so that does not happen or b) recover from that when it does, that's great.

I haven't read thru the whole thread, but I assume these are remote users and that's why you cannot use the conventional sync process. But that separation will just add to the likelihood of workflow and technical problems.

I don't have another solution, and I wish you success in all of this. Just plan for the worst case scenarios as well. And if I am misunderstanding some of this, I apologize - I am not being critical of anyone - just making sure you think about the things that can go wrong.

Good luck
Dan
kronhead
 
Posts: 100
Joined: Sun Jul 04, 2010 11:12 am

Re: Tutorial - Remotely Sync HanDBase for Android with Compu

Postby DavidDevaneyJr » Tue Mar 03, 2015 1:00 pm

kronhead wrote:I am just using standard Handbase sync between my phone and my computer, but I just wanted to post a few comments about this.

I am impressed at the creativity people are demonstrating to solve a business need. I just worry that you are creating a complex infrastructure that will occasionally result in file damage and loss of data. Here's an example of my concern: cloud sync is not instantaneous. It must move from one device, to the cloud, and then down to the other device. I realize I am stating the obvious. But phones or tablets lose connectivity all the time. People get interrupted in their work flow by a phone call or a text message. Also, you need to make sure that the phone user stops updates long enough for an up and down cloud sync, the PC based Handbase sync, and then another up and down cloud sync. Now, if the work process supports all of this, great - but I worry that people will decide to do an update on the phone, just when the PC based sync is happening, or something like that. If you can either a) be careful enough EVERY TIME so that does not happen or b) recover from that when it does, that's great.

I haven't read thru the whole thread, but I assume these are remote users and that's why you cannot use the conventional sync process. But that separation will just add to the likelihood of workflow and technical problems.

I don't have another solution, and I wish you success in all of this. Just plan for the worst case scenarios as well. And if I am misunderstanding some of this, I apologize - I am not being critical of anyone - just making sure you think about the things that can go wrong.

Good luck
Dan


Hey Dan,

I completely understand your concerns as they are definitely valid. This solution is a bit more complicated than the standard, supported HanDBase Sync, where you connect over WiFi while at the computer. So there is the chance of data loss. This is considered a "workaround" and is not supported by DDH Software. But it is an option for those users who are in need to be able to sync remotely. This would be particularly useful for users who need a one way sync of data, eg downloading an updated list of products or appointments daily, where there is less chance of data loss because only one side is being changed. I have accounted for most of the scenarios that could result in problems in the tutorial and have tried to warn users about those potential problems.

One of the benefits to this workaround is that it uses Dropbox or Google Drive as an intermediary. You aren't directly syncing all of your data to the Cloud Storage drive. That minimizes the chance of data loss there, especially on a record level. Additionally, this utilizes the actual HanDBase Conduit which, by default, makes backup copies of the databases prior to the sync. That way, if there is data loss, the data can pretty easily be restored.

I understand your concern about the workflow process and things like loss of connectivity. I do specifically tell users to complete the entire sync process at once and to not edit databases on the device during this process. As far as the cloud sync not being instantaneous. In my testing this did not seem to be the case. Granted there can be a delay, which is why testing is key. However because this workaround requires the user to manually initiate the sync of the files to Dropbox or Google Drive using FolderSync, that process is fairly instantaneous, assuming there are no connection problems on the computer side, which I also warn about. When I initiated the FolderSync process on my device, within a minute I was seeing Dropbox and Google Drive notifying me of the changed files on my computer.

Thanks for your comments.
Regards,
David Devaney, Jr.
DavidDevaneyJr
 
Posts: 134
Joined: Tue May 19, 2009 11:01 pm
Location: Lake Worth, FL

Re: Tutorial - Remotely Sync HanDBase for Android with Compu

Postby DavidDevaneyJr » Tue Mar 03, 2015 1:39 pm

One additional thought regarding Dan's concerns and Gabriel's question about multi-user syncing. As I mentioned, multi-user syncing would be theoretically possible but does become more complicated with this workaround. One thing I didn't mention before is that there is no way in this solution to know if someone is already performing a remote sync. If you have multiple users trying to sync with the same computer remotely it is possible that while one user is syncing a second user begins the sync process. This would cause issues because the scripts to initiate the HanDBase Conduit Sync could interfere. Either trying to launch a new instance of the HanDBase Conduit, obscuring the first and making it so the script doesn't function properly. Or it could even close the Sync window for the new user before the sync starts, causing the data to not get synchronized. The only possible workaround for that would be for the users to sync on a specific schedule. This would be complicated to do, making sure all the users keep to that schedule.

So, at this time, I probably wouldn't recommend trying to make a Multi-User sync work with this solution.
Regards,
David Devaney, Jr.
DavidDevaneyJr
 
Posts: 134
Joined: Tue May 19, 2009 11:01 pm
Location: Lake Worth, FL

Re: Tutorial - Remotely Sync HanDBase for Android with Compu

Postby DavidDevaneyJr » Tue Mar 03, 2015 11:49 pm

As promised, I have updated the AutoHotKey Scripts that go with this Tutorial. I have not replaced this section of the Original Post as those instructions will still work fine. Some users may prefer that as the updated instructions and scripts are a little more complicated. Instead I made a new Post on my site for these updated instructions. There is a link in the original Tutorial to these as well.

Why did I make these changes so soon after posting the Tutorial? After some additional testing I figured out a way in AutoHotKey to automatically select the HanDBase Conduit Partnership, rather than requiring it to be the first Partnership in the list. I have also added instructions for syncing these files between your Android device and Dropbox or Google Drive to make initiating the sync easier, with fewer steps.

For those not familiar with it, AutoHotKey is a Windows program that lets you write scripts to enable Macros on your computer. These can be used for a variety of things and the scripting language is quite powerful. If you visit the AutoHotKey website you can find out more about creating your own scripts, or modifying the ones I've included to better meet your needs.

To view the update click the following link.

Tutorial Update – Enhanced AutoHotKey Scripts when Remotely Syncing HanDBase Database for Android with Desktop PC via Dropbox or Google Drive

You can also go through the Original Tutorial and when you get to that section click the link to the update.

As mentioned previously in this post, this new update could theoretically make Multi-User Syncing possible. However please be aware of the warnings that Dan and I have posted here as well as those in the Tutorial. To me, the biggest concern is not knowing if another user is currently syncing when a second user starts their sync. At this time I would not recommend using this solution for Multi-User Syncing.

This Tutorial, which is more a Proof of Concept, was more intended for a user in the field who needs to update their Computer or Server databases regularly while in the field. It can also be used to download regular updates to a database, say a product list. In these cases it's less likely that both the databases on the Android device AND the databases on the Computer will have both been updated.
Regards,
David Devaney, Jr.
DavidDevaneyJr
 
Posts: 134
Joined: Tue May 19, 2009 11:01 pm
Location: Lake Worth, FL


Return to HanDBase for Android

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Google Feedfetcher and 3 guests