Friending non-humans: A lazy foodie’s hack for the Android address book

Probably not one my best characteristics but I do tend to order in a lot of food from a variety of places near my apartment. There are also enough places around where I live that I end up trying a bunch of different places and then when a familiar menu comes up again I am often left wondering “what did I eat there the last time, and how good was it?”.

I was half tempted to create a food journal app specifically for delivery food. Think of it as a Foodspotting / Foursquare app but more like a personal diary than a social app. Neat idea I guess, except I have almost no time these days. But then I got thinking: the People app on Android exposes a bunch of new social apis that I felt I could maybe use in some manner. Could I use the Android People app be used to “friend” my favorite delivery places?

One of the things Android has going for it for something like this is the Intents system and inter-app communication that are very core to the OS. This means quite a few applications are open to external data or expose their own data to external apps. My end “hack” basically involved creating a contact to represent each of my more regular delivery places and wiring it to different apps via URL patterns registered by some apps that I could find online. Since you can add many web links to each contact, I added a couple:

  1. A link to the mobile foursquare URL for the location. Since the Foursquare app registers itself as a handler to those links, clicking on the link on the contacts app launches the foursquare app for that location.
  2. A Google Docs file url where I can write about the dishes I ate at that place. Once again, since the Google Docs (now Drive) app registers itself as a handler for those urls, using that on the phone works well enough.

Check out the video below to see it in action:

 


 

My original goal was to tie it to my Foodspotting profile but that app does is completely closed and does not respond to any local intents or URLs.

For the most part this does let me do what I wanted to do. Look up the latest reviews/tips about a place, put down my thoughts about different dishes I tried there and then call them if I feel like it. In a more complete app that leveraged the people app social apis even more, the photos representing the places could also change, maybe representing a special dish or something.

But it does make me think the idea of contacts really does need to expand beyond the people in my life. I mean by definition, isn’t anything you can call or contact for more information a contact? Why can’t I  save a particular restaurant from Foursquare directly as a contact to my address-book since I usually call the place and not really a person there? Extend this thinking and you realize there are a bunch of “things” you often call: the taxi service, the hospital, the utility company, etc.

A lot of these thoughts are also probably a result of my reading reading a particular thesis by  John Kestner, an MIT student on creating “A Social Network for Lonely Objects“. Its a fascinating read and I definitely recommend it.

All of this also involves a rethinking of fundamental parts of the data that define a contact. VCards are a very human concept but we need to morph that construct into a more unstructured form, so that a contact of a particular type can create data fields relevant to it. The internet is already evolving to embrace unstructured data with NoSQL databases and such.

Kinda ironic that Android recently renamed the Contacts app to the People app in ICS 😉

Ice Cream Sandwich designs on Android

The biggest critique for Android (besides software update uncertainties) for the longest time has been the poor design of most Android apps. While some app developers did do a good job with their apps, the lack of any kind of design guidelines for developers meant everyone was finding his own way to create a good experience on the platform. This also meant that apps tended to look very different from each other.

The introduction of Ice Cream Sandwich design guidelines at the beginning of this year seemed to be a step in the right direction, but in the back of my head I was worried it could be a little too late. Fast forward merely 3 months and things are very different. More and more applications are conforming to the new guidelines and they look GREAT. The great thing is that with frameworks and libraries like the Android Compatibility Library,  ActionbarSherlock, ViewPagerIndicator and HoloEverywhere, the design guidelines can be used for pre-ICS apps as well.

Roman Nurik seemed to have the same thoughts in his mind so he started a Google+ thread on it . I wanted to take a few screenshots and share them here but as I started saving the images, there just seemed too many to list. So instead I just saved a bunch of apps to a Tumblr account. Check it out and follow it if you’d like to track updates. While I’ll keep adding to that as I find more, if you see and app that you’d like to see there, drop me a comment here or message me on Twitter or Google Plus

http://ics-apps.tumblr.com

Air for mobile’s weird touch implementation

Let me begin by saying that after playing with Adobe AIR for mobile for the last couple of weeks, I have been really pleasantly surprised by general performance. I have done quite a bit of mobile device development off late with both iOS and Android, but AIR might actually be a contender for my next project.

That said, I am kinda surprised by the touch event implementation. I am hoping someone will correct me if I am missing something but here is what I am seeing so far.

In AIR, you can now choose to set a Multitouch Input mode to either intercept raw touch events (MultitouchInputMode.Touch_Point) or have the touch events mimic mouse events and get separate gesture events from the flash player when gestures are performed (MultitouchInputMode.Gesture). Note: when gestures begin, you stop getting mouse events till the gesture has completed.

My first problem is that you can pick one or the other, but not both. The former will give you raw touch events and so you can see when more than one touch is on the stage, but then you have to write your own code to define what a gesture is. The latter gives you gestures but you’ll never know when more than one finger are on the stage. But what if you want to track touch points independently till a gesture begins? You are on your own there.

Additionally, There is no information on touch positions on the Gesture event. There is a localX and localY which I presume is the point between the 2 touch events, but they don’t change much as the gesture occurs (I was trying to read these values while panning halfway into pinching, the change in values isnt representative of how much my fingers moved) which seem to be the x and y points of where the gesture began and do not change as the gesture events change.

Also, Gestures like Zoom and Pan do work independently but not together. So If you are zooming (pinching) into an image using 2 fingers and then start moving the 2 fingers in a particular direction without changing the distance between the touch points (Pan), you dont get the pan gesture events. This is unlike the behavior on most apps that allow zoom and pan.

At this point I started looking to read raw touch point data. Here is another implementation gap. AIR requires the developer to keep track of every touch point (identified by toucheventIds). There is no data model that you can query on the AIR Player that gives you an Array of touchPoints. This is irritating and smells of poor API design decisions. Compare this with iOS’s api for touches where I get the set of all touch objects every time the time touches begin or change:


- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;

Anyway, thats as far as I have gotten so far. Maybe I am missing something but it seems that if you are really building something significant with AIR for mobile, you might need a custom non-Adobe gestures library.

Anyone know of a good one?

Location Check-Ins are the new Photos

Off late I have started using quite a few location based services like Foursquare, Foodspotting etc, and everyday more interesting apps crop up. However the current model for location based apps requires me to check into each app individually. The problem is when I am at someplace interesting enough to check in to, I am usually with people and I can only take so much time peering into my phone before coming across as rude to the rest of the group.

Compare this with how I interact with photos today. I take a pic and then can choose among any number of apps on your device that can do interesting things with it. Even better, I can manipulate the photos after the event I was taking the picture at.

I feel the whole model of checking-into a location has matured to a point where it can graduate from the app level to the platform level. I would much rather bring up some native location app and check-in to my phone. The check-in is an actual object, like pictures or music and it is now owned by me. It contains the location information as well as the time. Once checked in, I can “share” my checkin to any apps that can do something with it. So I can forward my checkin to Foursquare to inform all my friends I am there, to FoodSpotting to discover whats good to eat there and to any other app that may need that info.

This model has a number of advantages to it:

  • I am building up a location history that is no longer trapped inside one app or service.
  • I can choose to share my checkin with apps later (for example if my only motivation was to get some virtual points for being there, I can check into that service the next day)
  • I can checkin to multiple services in poor connectivity locations by only needing to pull in map images etc once.

 

Of course there are certain challenges here:

  • Some services like Foursquare may want to know immediately when you have checked in to present local offers etc. This could be done by the platform sending a system level event that these apps can listen to when a user checks in to a location.
  • Different services have different location data, for example Foursquare has a lot of geo data but Foodspotting may have better data on restaurants so there will be the need for some standard model of annotating the location with other meta information while the user is locating himself on the map. For example, the map the user is presumably zooming in to can show pins from different services with different icons.

 

Hopefully platforms like Android and iOS add this capability as a core part of the OS pretty much like we use maps today. Till then, the idea of using more than one or two location services at any point is pretty difficult.

The prettier side of Android

A lot has been said about the lack of UI polish in Android (sometimes rather obnoxiously), but over the last few months I have started debating how much of that is still relevant. When I first saw Android (around version 1.6) I was not a fan, but over the last couple of years having it as my primary mobile phone, I realize that while a lot of the applications lack UI polish, there are a lot of parts of Android that can be customized with very beautiful options. Most of the time these seem to be the work of communities of passionate developers and designers and often lacks mainstream visibility. Thats what prompted me to write this post.

 

HomeScreens, Launchers and Icons

Nothing gets the point as immediately across as http://mycolorscreen.com/, a site dedicated to customized homescreens (regardless of Android, iPhone, etc). The number of entries under the Android category however completely outweigh iOS since iOS offers almost no homescreen customizations on non rooted devices. On Android however, you can use a variety of launchers, custom icons and homescreen widgets to create a pretty amazing experience. DeviantArt for example is a great resource for custom themes and icons for different launcher themes (for example LauncherPro themes)

MyColorScreen recently also posted a blog entry on the 10 best customizations for 2011, definitely worth a look for some inspiration.

LockScreens

LockScreens is another area of a lot of visual explorations in the Android community. For the last few months I have been using WidgetLocker as a lockscreen app which lets me not only use background images, but also widgets on my lockscreen. Additionally WidgetLocker also lets you create custom themes and apply them. This XDA link has a HUGE list (374 pages) of some good ones.

Recently however I also tried MILocker which seems to have even more polished themes (though lacks Widgets-on-lockscreen functionality). MILocker is a port of the LockScreen app from MIUI Rom for rooted Android devices (I talk a bit about that below)

Core Apps

One of the teams that do awesome visual work are the guys behind the Go Apps. All of their apps are completely themeable and often replace (or override) the default Android apps. For example Go SMS (which I used till I recently rooted my phone and swapped for the new MIUI SMS interface) works seamlessly overrides the default SMS app on Android, and has some really fantastic themes available for it. Go Apps are available for very core Android functions including Keyboards, Dialers, etc.

Live Wallpapers

I have also recently come around to Android Live Wallpapers which I originally considered useless and mostly a battery suck (turns out the battery consumption is not that bad at all). These are animated backgrounds that you can use on your launchscreen. While some of them are just beautiful visually, others are actually very functional. For example I used to use Go Weather that had different animated backgrounds for the desktop based on the weather at the location. This kind of ambient information is pretty awesome. More recently I have started using the Aurora Live Wallpaper  (see my current homescreen below) since I find it very soothing to look at the Northern Lights every time I am on the home screen 😉 .

Custom ROMS

Finall, rooting your phone offers even more customization options since quite a few ROMs even offer themes that can be applied to the whole OS, though I imagine thats not for the faint of heart. I recently rooted my phone and am now using MIUI ROM that is just visually fantastic. It has customized all aspects of the OS like systemwide font, notifications and alerts and default applications for music, sms etc. The video below is a pretty comprehensive walkthrough of MIUI. Its just fantastic.

As a user interface developer who is passionate about design, I am pretty happy with my current experience on Android, but it took me a while to find a lot of the options to get there. There are a lot of communities like XDA Developers and ColorMeAndroid (on DeviantArt) that most people aren’t aware of. Hopefully these grow and Android gets more designers on the platform. The open nature of the framework and the apps that allow communities to customize them truly make the visual possibilities exciting.

Thoughts on inter-app communication and Siri-izing Android apps

Coming from developing iOS applications, the concept that struck me most interesting in Android app development was the way it handled inter-app communications. For the uninitiated, here is a simple way to understand how Android apps work:

  • Each Android app is composed of a few different parts: Activities, Services, ContentProviders and BroadcastRecievers
  • An Activity represents a single screen with a user interface. They usually constitute one complete “action”, like signing up or updating a status or something like that.
  • Users transition between Activity screens while performing a task. This is made possible by the Activity sending asynchronous messages called Intents to the Android system
  • Intents trigger the next appropriate activity. So, for example, a clicking on the share button sends a  Share Intent to the system that then pulls the appropriate share activity.
  • Activities from different installed applications can be mixed and matched to allow the user to complete a task. In the case of “Share” for example, apps like Tweetdeck or Facebook add the appropriate Share Activities so that the user may pick the one that he actually cares about.

The last point makes for very interesting scenarios. This means that app developers can relegate certain responsibilities to other apps the user may have installed. This is also what allows users to switch out the default apps with others. Prefer the new Firefox browser to the default Android one? Well, check off the box that always resolves the browser intent (or specifically the ACTION_VIEW intent) and now you’ll never see the native browser again. While the core Android intents are decently documented, there are even efforts on like OpenIntents.org that try to provide a central location for information on intents offered by third party applications.

When I first saw the Apple Reminders app introduced at the iOS5 keynote, it made no sense to me. Why build a mediocre reminders app when the iOS AppStore is full of really well done todo apps? It wasn’t until I saw Siri at the 4S launch keynote did that click: Reminders is the perfect use case for voice recognition and they needed an app to respond to the Siri “add reminder” trigger. Since then, I have seen a lot of developers get hopeful about when Apple will allow third party apps to be Siri-enabled, but I have a hard time figuring out how exactly that would work. In Android I imagine a central app that dispatches custom Intents like a system wide “Reminder” intent or other custom events that multiple apps can wait on, but I dont think any such concept exists in iOS at least today (hmm, the more I think, it probably could work using something like UIApplicationDelegate’s openURL method and a custom URL Scheme)

The video below by the folks at Remember the Milk showed how to add events to their app via Siri, but if the instructions are anything to go by, its a pretty smart hack but a hack nonetheless. Also I am not sure in this case if your tasks are being pushed to both RTM and Apple Reminders and if they are, I doubt the “done” action is synchronized as well.

Compare that with the second video here done by me using Vlingo, an off the shelf Android personal assistant app (very similar to Siri and surprisingly decent). The video below triggers the “Share” intent at which point I can pick any app from my list of installed apps that respond to that intent. Note that I could have also checked the checkbox there to always go to Remember The Milk (actually my preferred todo app right now is Astrid) but its pretty cool to see that not only did the task successfully get added but so did the day (“Tomorrow”) which is a separate form element in the “Add Task” Activity.

This kind of inter-app play makes for some very interesting possibilities. Its unfortunate that Apple seems to be going the exact opposite direction with apps on their platform. Apps on iOS are already pretty isolated from one another but now those rules are also going to be set on desktop software: a place where it makes even less sense.

On the flip side there are also projects that want to extend the concept of intents to the entire web. If you haven’t seen it yet, check out WebIntents.org. I am pretty excited about this, hopefully this makes it. It looks like both Chrome and Firefox at least are looking to support that kind of mechanism for inter app communication.

Update/epilogue:
I first got really interested in inter app communications when I was playing around with Macromedia Central back in the day. Central was Macromedia’s first try at Flash based desktop apps and never really made out of the developer preview, but it had some great ideas on inter-app communication.

Here is a snippet from their whitepaper on Central:

Hey Adobe, can we get this back in a future version of AIR?

Building TimePiece: My presentation from Philly Android Alliance this week

I gave a talk this week at the Philadelphia Android Alliance User Group on TimePiece, my open source Android World Clock app. We discussed some of the code and design patterns used in the application. Here is the slide deck from that presentation.

Thanks to everyone who came.

Introducing TimePiece, my first app on the Android Market

I am pretty excited to announce my first application is finally on the Android Market: TimePiece, a pretty little world time app (Go get it, its FREE!)

A couple of months back, after a series of disappointing searches on the Android Market, I started working on a World Clock app for Android phones. Most of the world time apps on the Market were functional but I really didn’t care for the design. The goal was to not only finally have an app I would like to use, but also really grok the Android framework. I had played with Android on and off for quite a bit while my day job remained developing iOS apps, but I figured nothing teaches you as much (by forcing you to deal with all the annoying details) like going all the way and publishing an application to the Market.

For bonus points, I have released the code for the application under the MIT Open Source License. So if you want to fork it, go for it. And if you see something you think can be done better, please let me know.

One thing I did want to ensure was that the app did not use any web API, and rather used locally stored data. This limitation forced the timeline of the project to exceed my personal deadline but I think it was worth it. The city data comes primarily from http://citytimezones.info/ but had to be massaged quite a bit to find the appropriate Java TimeZone IDs and then leverage the Joda Time library to show the correct times while respecting things like daylight savings times. The massaged data was stored in a local SQLite database that the app uses.

In the next few weeks I’ll talk about a few implementation details and my experience coming from the Flash / iOS world. In the meanwhile, if you have an Android phone, give it a shot and let me know what you think. Also please rate/comment on the app on the Market. I’d love to see the app actually be used :).

So I discovered Android Launchers last weekend

Last weekend, I found an interesting link on Android AppStorm on beautiful replacements for the default launcher on your device. A Launcher is the default home screen on the device and displays the launch icons for all the installed apps. Like almost every component on Android, you can install different launchers just as you could any other application. Launchers not only change interaction models but also icons of the installed apps.

I had been vaguely aware of launchers but had never tried one. But the designs on the AppStorm link looked really awesome so I installed ADW Launcher on my Galaxy Tab and have since been trying a bunch of themes. Check out a couple of screenshots of my Galaxy Tab, running the AndroidPhone7 theme and Buff theme.

Windows Phone 7 Theme Buuf Theme

 

The themes I have been playing with so far have been pretty awesome and I keep finding great icon designs for the different experiences. The icing on the cake is that ADW is an open source project as is LauncherPro and am sure some others as well (This post lists the different Launchers that seem to be popular). Some of the other launchers, like SlideScreen for example, completely change the traditional launch screens. Its awesome that Android enables this kind of customization. (I hacked my old iPhone a couple of times to enable custom themes on it, this article on the Cult of Mac lists 15 of them, but require you to jailbreak your phone to enable them).

My main phone still remains the Google Nexus 1, which I really like but am now in the market for a new phone now that my contract is finally up. I have never liked the customized launchers that the different device vendors pack and so have been hesitant about getting something besides the Nexus S. Knowing that I can swap out the Launchers makes me feel a lot better about being able to control that experience.

Announcing Android Alliance Philadelphia (and our first Happy Hour)

I am pretty excited to announce Android Alliance Philadelphia, a group focused on bringing together developers, designers and passionate users together to share ideas and learnings with each other. The group will be modeled around most of the other user groups around Philly like Philly.rb and CocoaHeads, meeting about once a month and occasionally for happy hours. We are also planning to have a few events in tandem with these other groups so stay tuned for news on that front.

Like most self respecting user groups we now have a Twitter account (@androidPhilly) that we use to occasionally send updates on upcoming meetings or interesting goings-on in the Android community, and a Google Group for more elaborate discussions. Considering the group is already 60 people strong, looks like the group definitely addresses a need. If you would like to participate, please follow us on Twitter and/or join the group.

At this moment we are drawing plans for events for the rest of the year but instead of doing it in isolation or on the group mailing list, we figured it may be a good idea to organize a midweek happy hour to bring the group together and see what they’d like to see here. We are planning to meet at National Mechanics around 6pm this Tuesday, March 22 . If you are in the neighborhood, I hope to see you there 🙂