Syncing your own data

Jim Brown

Active Member
Licensed User
Longtime User
Hi all,

This is an area where I have liitle experience in, so I am looking for some general guidance in how best to sync or share data automatically between 2 android devices

Device 1 - Samsung Galaxy S phone
Device 2 - Samsung Galaxy Tab *

My current B4A app stores a simple LIST of words on the device. I want to somehow export this and have device 2 automatically (or manually) import the same data.

I don't know where to begin though. What are my best options? Ideally I want to upload the data so that is permanently availble. I have no clue what service to use. Any pointers?

* BTW I just bought the Galaxy Tab and its a sweet device. Especially with Gingerbread ROM!
 

kickaha

Well-Known Member
Licensed User
Longtime User
If they both have Bluetooth I would use the serial library and transfer the file via bluetooth using AsyncStreams.

There is a good tutorial on the serial lib here
 
Upvote 0

Jim Brown

Active Member
Licensed User
Longtime User
I thought about this as an option, and its likely that this is the method I would end up using

However, ideally I would like to use a sync method whereby the small file is uploaded to the internet. Then, if I use device 2 the app there would check the date stamp of the file and automatically download it. Is this something which can be done by Google docs?
 
Upvote 0

admac231

Active Member
Licensed User
Longtime User
A method I have used in the past is to have 2 files: the file containing the list data and a version file. Use HTTP library to download the version file and check against current version. If it's bigger, download the list file.

As for uploading both the files, use the FTP library (incrementing the number in the version file before uploading).

Alternatively, I'm pretty sure the FTP library allows you to get the last modified date of a file.

For either of those methods you will need web space, specifically one that offers FTP access. Most free hosting providers offer FTP access but they can be somewhat unreliable.
 
Upvote 0

eps

Expert
Licensed User
Longtime User
You could look at C2M... although that is limited in data packet size.. and not really the function of C2M, but it would work as expected.
 
Upvote 0
Top