Sunday, July 10, 2011

Google Map Maker

For those that don't know, Google Maps just opened up the Google Map Maker web application to allow normal users to enter data into Google Maps. After a review process, those edits can be published into the public Google Maps for the world to see. I was pretty excited when I learned about it in April, and I've been pretty active.

Recently I received an e-mail from the Google Map Maker Community Team. Because I'm "one of the top mappers in the United States," they offered to send me a free t-shirt, and invited me to the Google Geo User Summit in Mountain View. I had to regretfully decline the offer to attend the summit, but the t-shirt is pretty awesome.

From July 2011

My friends and I were trying to figure out what the map on the front is showing. At first glance, it looks like a map of the world's lights at night, but some major countries, like the US, Canada, UK, France, and Russia are not lit up. So what do the white areas represent? My speculation is that those represent major road systems that Map Maker users have added which were not previously recorded in Google Maps, but I'm not sure. Does anyone know?

Friday, July 8, 2011

Graduation Videos

Check these out! Courtesy of Munchkin, thanks friend!



Sunday, July 3, 2011

Exploring Google App Engine with Restlet and Objectify

Warning: this post is excessively geeky for my usual audience. Non-programmers, feel free to skip.

I've been doing a little more exploration with Google App Engine. I've used it before, first for my Weasley Clock, and also for one of my classes, Object-Oriented Analysis and Design. In that OOAD class, my team and I had a short amount of time to build an Android app backed by a RESTful web service on GAE. We ended up using JAX-RS/Jersey as a RESTful framework, JAX-B for server-side XML serialization, and JDO for the datastore API. Then on the Android client, we used the Apache HTTP client and SAX parsers. That worked out alright, but recently I've wanted to explore what other options are out there.

I've been interested in Restlet for a while; in OOAD, I explored that first before moving to JAX-RS. It seems to be a pretty comprehensive solution. They provide both server and client libraries for many platforms, with flexible configuration for many needs, such as filters. What turned me off last time, and almost again this time, was that the source code for the "first application" example didn't work out of the box. I had to decide which version of the library I needed, download four different editions, and figure out which .jars to put where. Then for a long while, I was stuck on an interesting bug. Apparently, GAE doesn't support chunked encoding (whatever that means), so their current stable 2.0.8 libraries won't work for GAE/Android communication. Their 2.1m5 libraries have a workaround, but one must manually specify that entities must be buffered (once again, what?). I also paired their 2.0 "first application" example with 2.1m5 libraries without realizing that there was a difference, because their wiki wasn't clear about which version of the sample application you were looking at.

So far, I would say that Restlet is a well-built library for RESTful communication, both server and client-side, but their documentation and examples could really use some organization help. The answers are on their site, but sometimes they seem to be hidden away in dark corners of the wiki.

After I got the Restlet "first application" working, I wanted to bolt on datastore support. I wanted to try something other than JDO, and so looked at JPA. However, these both seem to be cumbersome and ill-fit when it comes to the GAE datastore. Then somehow I stumbled across Objectify, a relatively thin library that works on top of the datastore low-level API. Some of the attractive features were a less-cranky Key interface, using POJOs instead of GAE-specific Entities, and GWT compatibility without DTO's. I did have trouble with that GWT part for a while, because I thought that my POJOs still needed to be annotated with java.persistence.Entity. I think that was causing problems when the DataNucleus Enhancer went and did its magic; the server-side class looked different than what GWT was expecting on the client side, which ended up throwing a SerializationException. However, I finally figured out that stored entities don't need the Entity annotation. The only thing that the POJOs need is a java.persistence.Id annotation on the primary key field.

I have yet to really explore this thoroughly, but so far both libraries seem to be doing their job and playing nicely. The best part was not having to write DTOs! I did have to fight with both libraries for a while, but hopefully this post will help somebody else avoid those pitfalls.