PDA

View Full Version : What prevents initiating sync from device or computer only?



tbessie
06-18-2010, 10:57 AM
Hi all...

I was wondering - what prevents USB sync from being initiated from either the phone or the computer (using CompanionLink USB)? It seems they need to be initiated in both places (and cooperate), as opposed to, say, in the Palm or Windows Mobile worlds, where you can initiate sync from either side and need do nothing else.

Is there something in Android's design that doesn't allow this?

- Tim

Eric
06-18-2010, 11:30 AM
Tim, the sync is initiated from DejaOffice on the Android. The SD card in the Android must be "mounted" before CompanionLink can sync to it, and mounting is controlled from the Android, so that's why you need to tap "Sync" in DejaOffice to start the sync (at which point DejaOffice will mount the SD card). You don't have to do anything in CompanionLink USB, but it does need to be running in the background (you'll see a little CompanionLink icon in your Windows system tray at the lower-right).

tbessie
06-18-2010, 12:35 PM
Tim, the sync is initiated from DejaOffice on the Android. The SD card in the Android must be "mounted" before CompanionLink can sync to it, and mounting is controlled from the Android, so that's why you need to tap "Sync" in DejaOffice to start the sync (at which point DejaOffice will mount the SD card). You don't have to do anything in CompanionLink USB, but it does need to be running in the background (you'll see a little CompanionLink icon in your Windows system tray at the lower-right).

I'll have to look again, but there seemed to be lots of "Press OK when the sync is done on the computer" and "Press OK when the sync is done on the device".

I was hoping more for something like Palm sync. You click/select one thing on the desktop, or one thing on the device, and walk away and there are no more prompts, and it eventually just finishes.

Can't CompanionLink and DejaOffice cooperate in such a way as sync can be initiated anywhere (CompanionLink tells DejaOffice to initiate the mount, for example), and there need be no "Press OK when sync is done" prompts?

- Tim

Eric
06-18-2010, 04:48 PM
Great questions, Tim. You'll get a message on the PC when the sync is complete, but it will go away after about ten seconds if you don't click OK. So really you can run the whole thing from the Android. However, you will need to tap "OK" in DejaOffice to let DejaOffice know that the PC has finished syncing. The answer to your original question, "Is there something in Android's design that doesn't allow this?" is yes, there is something in the Android design that doesn't allow a one-tap solution. It has to do with mounting the SD card. The Android's SD card can only be mounted/unmounted from the Android. So what happens here, when you press "Sync" in DejaOffice, is that first DejaOffice runs any sync from the native contacts/calendar to the DejaOffice database, then it mounts the SD card, at which point the database becomes inaccessible to DejaOffice, but now can be read by the PC. So CompanionLink finishes its sync process, but it cannot unmount the SD card, even if it were to use Windows to "eject/safely remove" the card. So this is why DejaOffice is depending on you to tap "OK" to let it know that it's okay to unmount. Once the SD card is unmounted, DejaOffice can read the database again and finish up its part of the sync. We'd love to be able to run the whole sync with just one button press; it's just not technically possible.

tbessie
06-18-2010, 06:18 PM
Great questions, Tim. You'll get a message on the PC when the sync is complete, but it will go away after about ten seconds if you don't click OK. So really you can run the whole thing from the Android. However, you will need to tap "OK" in DejaOffice to let DejaOffice know that the PC has finished syncing. The answer to your original question, "Is there something in Android's design that doesn't allow this?" is yes, there is something in the Android design that doesn't allow a one-tap solution. It has to do with mounting the SD card. The Android's SD card can only be mounted/unmounted from the Android. So what happens here, when you press "Sync" in DejaOffice, is that first DejaOffice runs any sync from the native contacts/calendar to the DejaOffice database, then it mounts the SD card, at which point the database becomes inaccessible to DejaOffice, but now can be read by the PC. So CompanionLink finishes its sync process, but it cannot unmount the SD card, even if it were to use Windows to "eject/safely remove" the card. So this is why DejaOffice is depending on you to tap "OK" to let it know that it's okay to unmount. Once the SD card is unmounted, DejaOffice can read the database again and finish up its part of the sync. We'd love to be able to run the whole sync with just one button press; it's just not technically possible.

How about if DejaOffice read all the databases it needed into main memory (or temp built-in memory), synced in-memory with CompanionLink through software or some other protocol via USB, and when done, wrote out its changes to the SD card as necessary? CompanionLink wouldn't need to even know the SD card existed.

That is, syncing via a protocol implemented by both CompanionLink and DejaOffice, without getting the SD card involved?

That would seem the most logical to me.

Unless, of course, Android doesn't allow a program on the device to talk via USB to a program on your computer without involving some intermediate storage format like that on the SD card.

Or perhaps it allows it, but you as the developer would have to write the API yourself?

I'm talking about conduit-style syncing, like on the Palm, I suppose. The two programs talk, rather than the program on the PC needing any direct access to storage on the device. The conduit does a lot of the protocol heavy lifting.

- Tim

Eric
06-21-2010, 05:00 PM
Hi Tim. We can't write directly to working memory (not allowed by Android), so we write to the SD card instead (which requires mounting/unmounting from the device).

tbessie
06-21-2010, 06:55 PM
Hi Tim. We can't write directly to working memory (not allowed by Android), so we write to the SD card instead (which requires mounting/unmounting from the device).

What I mean is, why the need to mount the SD card at all? Why not:

CompanionLink<->DejaOffice[writes to SD card]

Why would CompanionLink need to see the SD card, if DejaOffice can just talk to CompanionLink via USD and write to the SD card itself? No mounting needed.

Perhaps there's something I'm missing here.

- Tim

DJOCTO
06-21-2010, 10:15 PM
Tim,

Android design.

For whatever reason, when connected the card either has Mounted or Unmounted status. If Mounted, the PC can see it, but Android Apps can't. If Dismounted, Android Apps can see it, but PC can't.

So there is no state currently available where both the Android App, and also a PC App, can share data. It has to be a handoff.

This is the design of Android OS. It apparently has only to do with SD Card status, although there is no other status or communication capabilities through USB.

Rumors say that in some future version of Android, MTP (Music Transfer Protocol) may exist. More likely, CompanionLink will soon support Wi-Fi sync which will allow data to be transferred "live" without the need for the Mount/Dismount protocol.

tbessie
06-22-2010, 01:31 AM
Tim,

Android design.

For whatever reason, when connected the card either has Mounted or Unmounted status. If Mounted, the PC can see it, but Android Apps can't. If Dismounted, Android Apps can see it, but PC can't.

Huh, well that's pretty sucky. I guess it was Google's way of avoiding PC/Android resource contention. I can understand their motivation, but it then forces these kinds of workarounds. Google, I must protest! :-)


So there is no state currently available where both the Android App, and also a PC App, can share data. It has to be a handoff.

This is the design of Android OS. It apparently has only to do with SD Card status, although there is no other status or communication capabilities through USB.

Again, *REALLY*? What was Google thinking? Jeez. (I'm serious - PC apps should be able to talk via USB with Android apps without the need to hand off data via the SD card or anything like that; seems like a weird requirement).


Rumors say that in some future version of Android, MTP (Music Transfer Protocol) may exist. More likely, CompanionLink will soon support Wi-Fi sync which will allow data to be transferred "live" without the need for the Mount/Dismount protocol.

Well, I thank you for all this info - I've downloaded the Android SDK and mean to try my hand at writing some small apps to learn some of this stuff. I think I heard it uses a limited Java JVM for development, and since I do Java development, that shouldn't be too tough. I used GWT for a project once, though, and though it was clever, found it pretty limiting as well (one gets fooled into thinking one can use any Java classes, but keeps hitting the walls of whatever Google has deemed blessed to be JavaScript-able).

It'd be nice if Android allowed low-level protocols to be used by developers, so that even if the SDK didn't support a particular protocol, a 3rd party could always write a plugin for it. But I suppose Google doesn't make that easy.

- Tim