Summary (From my POV on Android):
Sync Server doesn't use any authentication or ownership tracking.
GCM-XMPP bridge needs a lot of love
We need to define a different connection lifecycle for GCM.
The in memory data store is problematic because clients and servers
must be stopped and started atomically
We might want to show off syncing different types of documents (i.e.
a todo list in addition to Luke's hobbies)
Fixing the GCM bridge is probably a couple weeks of work to get it
"solid". That will be a good alpha.1/preview to show off.
So Last week I put together a demo to try and stretch the legs of the
Android Sync Client APIs.
It crashes, a lot. Which is a bit to be expected as the code hasn't
really be used for, well, anything until now. We will get to that though.
Here is the alpha.1 workflow. You log in and you see your docs. You can
edit your docs or you can create new ones. In the future I would like
to add sharing and collaboration but that's the future. Here's a flow
chart for the visual thinkers out there (with real screen caps from the
real working app)
To make all of this work I use a RESTful server which tracks a user's
username and the documents they "own". The sync server just syncs and
serves the document you ask for. It has no authentication and any doc
you ask for you get to be an editor on.
The client uses the GCM XMPP¹ bridge I wrote while drunk on the side of
a mountain and it shows. The biggest issue is that shadows for
documents aren't getting created right sometimes because either 1) the
client or server bounced and the data stores are no long synced or 2)
the server thinks there are more clients than actually are connected.
GCM-XMPP doesn't supply connection/disconnection information like
WebSockets will. Instead we just know that some messages we sent a
while ago weren't delivered. We need to figure out how to turn this
into connection and disconnection information in a way that lets the
shadows exist correctly.
Another issue that needs to be addressed is using something other than
the Luke Skywalker hobbies document. (Or maybe showing off multiple
document types in the demo). I'm up for suggestions.
Anyway, the principles (diff sync with a restful documentId broker for
security) are sound. I think we can buff out some implementation
details and have a good alpha/preview/poc release in the few weeks -> 1
month time frame for Android and the sync server.
>>Phone:404 941 4698
>>Java is my crack.
1. The sync server has two client connection technologies : WebSockets
and GCM-XMPP. Android uses the GCM-XMPP because it takes all of the
nasty connection handling code and gives let's Android deal with it.
More info here : https://developer.android.com/google/gcm/ccs.html
What data is needed for instanciating a sync client on each of the
On Android we need the clientId (for the sync server) and the senderId
(for the GCM-XMPP bridge).
I know that for netty/websockets we also need a URL for the server but
not the sender id. Am I missing anything else?
>>Phone:404 941 4698
>>Java is my crack.
I've been envisioning a plan for UPS migrations, and would like to get
some feedback from the community, so here it is:
When there are model changes, it's kinda annoying to generate the sql
migration files. This is one of the reasons Erik Jan de Wit started
working to add liquibase to the project, allowing for seamless
I'd like to build upon Erik's initial work and prepare a `ups-migrator`
`-- <jdbc drivers>
`-- <liquibase & deps>
This migrator tool can be run with plain `java -jar` and deals with all
the migrations needed up to `VERSION`, which means we would need only
one migrator tool for both 1.0.x and HEAD.
a little heads up on an issue that I‘ve been looking the last days, on how to proper support both an Obj-C and a Swift library (in-parallel) on Cocoapods. There was a discussion on the cocoapods issues tracker basically around two ideas:
a) being a separate project, with a new name plus utilising Swift specific language propers.
b) having one project, utilising cocoapods subspec mechanism to include specific files per spec requested. In a nutshell users will employ in their Podfile something of a form:
pod “MyFooBarLibrary/Objc’ (objective-c)
pod “ MyFooBarLibrary/Swift’ (Swift)
Solution (b) was intrigued and went on to discover more, since I haven’t used before the subspec mechanism and was a good opportunity to learn. The issue mentioned two projects, QueryKit and ReactiveCocoa (their Swift branch) that utilise this mechanism, so I dive in trying to see how it works.
a) both projects are designed with ‘Swift first’ approach, employing _some_ 'Objective-C code’ to ease the interaction in a mixed project e.g Objective-C code calling the ‘Swift’ library, see  where the author describes more details on this.
b) since ‘Swift first’, both produce frameworks where they can be integrated either in objective-c or swift language projects, no ‘static-library’ targets.
c) both are designed for iOS >= 8.0
To make it short and from my understanding, the projects are _not_ designed around the idea of: take either the Objective-C or the Swift port in you project, but instead employ an Objective-C subspec to “ease” the interaction in a mixed environment, aka Objective-C code calling the Swift library.
Regardless and to better understand, I did some testing with our push-sdk:
a) having a single Swift Project employing both the objective-c code and Swift code
b) having a .workspace with a) Obj-c xcodeproj, b) Swift xcodeproj.
In both cases, this mixed approaches, at the end caused issues and wasn’t able to generate a proper solution. Issues around a) cocoapods 'pod install’ steps, b) tests on the library are done with two different dependencies c) various other integration issues…
It’s my sense, the most clean way is to go with separate libraries, that is solution (a) described above (a solution proposed also from @orta ) This has the added benefit of cleaner 'logistics’ that is: commit history, releases, static/framework library generations etc etc.
But there is one issue if we go with separate approach: _cocoapods naming_, that is how to properly separate between the two.
Currently searching for AeroGear-Push in cocoapods.org site we get the following:
In my cocoapods PR  I went with the approach to name the ‘Swift’ equivalent library as 'AeroGear-Push-Swift’, so the same searching above will reveal:
Some of you have already noticed, that the ‘hyphen’ character as a podspec name doesn’t work well with a Swift Project, cause the podspec name is used as the name of the final #import statement the user does. That is the following import statement doesn’t work:
Solving this, there are two approaches:
a) rename both library podspecs : Objective-C to -> AeroGearPush and Swift to -> AeroGearPushSwift
b) continue the same naming, but use the new ‘module_name’ podspec directive in the Swift project(added in cocoapods ) to specify the final module name the user will use on the import. That is the approach I have taken in my PR
If we go with (b) the entries will look like this:
Obj-c: (no changes needed)
Podfile: pod 'AeroGear-Push’
Class: #import <AeroGearPush/AeroGearPush.h>
Podfile: pod 'AeroGear-Push-Swift’
Class: import “AeroGearPush” (notice _no_ ‘Swift’ postfix is needed cause of the ‘module_name’ override)
I am fine with both albeit more towards (b) mostly not to break existing ‘pod installs’ the users may use and since support with the ‘module_name’ directive is provided from cocoapods. Current PR goes with this approach.
Let me know your comments and suggestions