Yesterday, Peter and I talked about “Cross-Platform Mobile Development with Eclipse” at EclipseCon in Santa Clara. After some conceptual slides telling about the difficulties one face when targeting different platforms (in our case iPhone, Android, Windows Phone 7 and minimalistic, mobile web), we went over to some live-hacking.
First, we presented a domain-specific language for data-driven mobile applications. Our goal was to build an application similar to the official EclipseCon conference apps during the show. The application listed every speaker with a picture, bio and a list of talks. Also, a schedule for every day could be browsed where details of both speakers and sessions were revealed once you clicked on an item of the list.
As you might know, there are quite a few options to produce cross-platform native (and look-alikes) mobile applications from a single source. As itemis is specializing in model-driven approaches, we picked a domain-specific language to describe the application together with a code generator that produces the appropriate source code of the different platforms.
For the iPhone, we started by adding a “News”-Tab listing recent blog posts written by employees of itemis. The code generator produced Objective-C code as expected and we had the first native application right on the screen.
On Android, we enhanced the application a bit further. Based on the names of the blog authors we built a mash-up and integrated each blog entry with the related speaker’s profile of the existing conference app. The generator produced the needed Java code and we happily deployed it on the “gorgeous” (as Peter said) Android Emulator.
Yet another set of generator templates produced a Python/Django web application we pushed to the cloud as we went on. It was running on the Google App Engine and represented what I am recommending to most of today’s mobile endeavors: “Have at least a minimalistic mobile web site that runs on any phone”. One of the attendees brought a BlackBerry Bold on stage to proof everything worked out fine – thanks for that!
Now, the tricky part began. One of our iPhones served as an external camera and “Lazy Peter” used GitHub to push some generated C#-code from his MacBook to an instance of Visual Studio running inside of a VMWare virtual machine (the reason being that accessing code on a networked drive is being considered harmful by Visual Studio). From there, Peter deployed this automatically produced app to a phone running Windows Phone 7.
For the grand finale, we put all of our phones (iPhone, Android, Windows Phone 7) plus two of the attendees’ BlackBerry devices running the mobile web app on a table and put this lineup on the two big screns with our iPhone camera to show how we used one single model to generate native apps for the various platforms while taking advantage of their respective UI paradigms (such as Pivot Controls on WP7).
For Peter and me, it was great fun to see what one can accomplish within half an hour of live-hacking on stage. Unfortunately, we couldn’t talk to everyone who came to the front after the show but we’d love to answer every question you’ve got. At EclipseCon, you can find us at the Xtext booth on the first floor, or at the bar later at night. Also, please feel free to follow us on Twitter (@HBehrens and @peterfriese) or drop us a mail.
We will both attend the Xtext tutorial tomorrow morning
- Pragmatic DSL Design with Xtext, Xbase and Xtend 2
Thursday, 10:30, 2 hours and 30 minutes | Ballroom A
Sven Efftinge (itemis AG), Sebastian Zarnekow (itemis AG), Jan Köhnlein (itemis AG)
and start polishing what we presented. Later, we will publish it on GitHub. I will provide a link here, as soon as we are done. Please, stay tuned.
- Our Slides on Slideshare
- Official iPhone conference app
- Official Android conference app
- Minimalistic website on Google App Engine
- Source Code on GitHub (coming soon)