Tuesday, May 04, 2010

Google, where is the calendar API in Android?

We are in the middle of a lot of debates these days: is Apple the new Microsoft? Is Microsoft following Apple with Windows Mobile 7? Should HP open source WebOS (more on another post, my answer is yes)? Is Google Android open or closed?

I have been bashing Apple for months (years?) because of the lack of Calendar API on the iPhone. It was a very large visible sign of closeness on their part. A lot of apps need to create an event on the calendar (thing anything medical, where you need a reminder) and the lack of API access was hard to comprehend.

Now Apple finally opened the calendar API with iPhone OS 4. Curiously, though, if you download and install the emulator, the API is not there yet. But one can only be optimistic: they have documented it, presented on stage, it is going to show up one day... That day, we'll start developing for it...

I was quite happy we finally had a chance to build the calendar sync on the iPhone and iPad, when I received a note from one of our developers. The email explained we had problems building calendar sync for Android. They added that the reason was that there is no public calendar API on Android.

Whaaat? No calendar API on Android?? Are you kidding me????

Unfortunately, developers do not lie, so it is true (had I heard it from a marketing person, it would have been quite different ;-) There is no public calendar API on Android. Unbelievable.

Wait, but Android is open source, right? You could download the calendar client, compile it, put it on the emulator (which does not ship with it), add the data provider and you would be good to go. No need for public APIs when you have access to the source code.

Right?

Wrong...

You can do all that, and it works pretty well when you just read the calendar. However, as soon as you try to write to it, creating a new calendar, Google gets upset. At the next sync with Google Calendar on the cloud, any calendar that is not on the Google servers gets wiped out on the device. Not nice. Not nice.

Any other option? Yes, one is to create a calendar in Google and write to it on the device, ultimately doing double sync (one in Google Calendar, one in your Funambol server). It is like double dipping, though, and the likely effect is spreading duplicates instead of germs. Bad idea (but we are going to explore it).

On top of it, I have no idea what happens with devices that ship with a modified UI, such as MOTOBLUR or the HTC Sense UI. I guess the behavior might be different: yep, I know, I said once that fragmentation is innovation, maybe I was wrong :-))

Overall, I am a bit shocked. An operating system that is meant to be open and one of the most basic APIs is closed... Is Android open or closed? You pick ;-)
Posted by Fabrizio Capobianco at 16:49  

12 Comments:

Anonymous Anonymous said...  

though i think its messed up that you don't have access to the calendar API's, Android is hardly closed... its not one or the other, but I was surprised to read what you just wrote!

Comment Posted at 17:55

Anonymous Steffen Müller said...  

That is really bad news. I was really looking forward to calendar synchronisation.

Just as a side note: would it work if the calendar is not synced with google calendars? Because I know quite a lot of people (including myself) that do not want to use the google calendar and would not miss it if it was disabled...

Any suggestions? What should people using a CRM that utilizes Funambol to sync their clients do?

Comment Posted at 01:04

Blogger Eetu Huisman said...  

While Android definitely is more open in a lot of senses than iPhone OS, for example, it is nowhere near as open as Maemo/MeeGo. On the other hand, certain parts of the Maemo 5 implementation on Nokia N900 are stil not as open as they should be.

Currently the most open mobile OS/platform is probably Openmoko, but it has hardly any momentum. It will be interesting to see how MeeGo evolves, hopefully the ecosystem will be stable enough to allow developer adoption and still dynamic enough to enable real innovation.

Comment Posted at 04:18

Blogger wpeters1981 said...  

if its not open how come synthesis
has a fully functioning calendar sync for android?

Comment Posted at 04:35

Blogger Fabrizio said...  

@wpeters1981 because they did what I wrote in the post, taking the calendar from the open source repository, recompiling, and so on. The difference is that they decided it is ok to have a Google Calendar to sync to. That is, your Funambol calendar ends up in Google calendar and you have the double syncing. And you have to create a Google Calendar first to sync with. Allo of which does not make much sense.

fabrizio

Comment Posted at 06:06

Anonymous Mathew McBride said...  

I've spent last night and this morning trying to get the Calendar application onto the emulator (its never been included)

While the Calendar and CalendarProvider application is in the source - its part of the output artifacts when you build Android, there appears to be a good reason why Calendar is not included in the emulator image.

Its hard wired for Google's applications. No point including it if the emulator isn't considered a Google device.

Some of the porting efforts over at xda-developers.com appear to have worked around this by taking an image from a retail phone (i.e Nexus One) rather than building from source. This way they get the gapps etc.

I also note the lack of todo list application on Android.

I get the impression Android is very much a consumer mobile OS... My WinMo phone still serves me well for this reason.

Comment Posted at 20:40

Blogger Brandon said...  

Yeah, more specifically, there is no Calendar as part of Android. There's the Google Calendar app, but its not a part of the base code, which is why the Droid shipped with a separate Corporate Calendar app for doing Exchange Calendar sync.

FroYo does have built-in support for EAS calendar sync, which sounds like they're moving towards including calendar in the base code ala the contact code. Before that happens, to support the largest number of devices, you'd probably have to write your own complete calendar app, including storage and sync to your own provider. Due to the way things work on Android, you should be able to listen for the same intents, so you can be just as first class as the google calendar app, but the user would have more than one... though maybe that's not much of an issue if they never use the Google one.

Comment Posted at 22:38

Blogger Chris said...  

Putting aside the truisms that the calendar and some of the other apps are not part of core android (@Brandon) and not open source, there is at least some mention in the API docs on how to access the calendar data using the content provider: android.provider.Calendar.CONTENT_URI
More can be found here:
http://developer.android.com/guide/topics/providers/content-providers.html

The better way to add/sync/whatever would be to use the Google Calendar APIs that are readily available:
http://code.google.com/apis/calendar/

Since the Android calendar synchs OTA there should be no issues unless you are disconnected.

@Steffen Müller You're using a google phone, why wouldn't you want to use Google Calendar?

Comment Posted at 08:47

Anonymous Anonymous said...  

"You're using a google phone, why wouldn't you want to use Google Calendar?"
Well, maybe someone wants to keep his private or business data 'private' and not hand it over to google.
I do not see any reason to share my contacts/mail/calendar with google.

Comment Posted at 00:21

Anonymous Pedram said...  

I latest Synthesis and created a new calendar using that, connected to SyncML compatile server and I got my calendar synced without any duplication or copying across my Cal data to Google calendar (which I never use it). I tried on it on Froyo.

So could that a possible solution for Funambol?

Comment Posted at 04:20

Anonymous Michael said...  

I am going to build one, REALLY! I have too any way...I will post it on my web site Blog.WebAndData.com....I hate wasting time and all the bull that comes with companies that think they have something you cant create. I will start by looking at a grid and tying it too a Date object and then looking at web services to tie it in with my online service that I need for my client. Mike

Comment Posted at 05:48

Blogger Song1w said...  

http://groups.google.com/group/android-developers/browse_thread/thread/b207cad25a2a29e5/911d26fa97502e98?lnk=gst&q=calendar+API#911d26fa97502e98

Look at what Android people say... Too many posts asking for calendar API, which shows that developers really need this feature.

Comment Posted at 09:55

Post a Comment

Links to this post:

Create a Link

Back to My Blog