EspressoReader, Flash

Introducing SuperLoader: a better AS3 library for fetching images

This post is way overdue but in any case, I’d like to introduce (rather belatedly) SuperLoader, an image loading library for AS3. The library grew out of my work when I was building the magazine view for EspressoReader. The magazine view builds a visual grid from the images found in a collection of blogs you are browsing. Here is a screenshot of the experience:

While building the Magazine View, I was faced with a problem. Each “page” of the view read 10 blog entries and then needed to find the most relevant image to show in the interface for each entry. Posts tend to have multiple images and a lot of them are not usable. For example, the image may be a tracking 1×1 pixel image used for analytics or may be too small or large to be effective. Loading each image using a Loader was not feasable since the loader only gave dimension information once loading had been completed and I didnt really want to load a bunch of images completely only to discover they weren’t useful.

The SuperLoader library  takes care of this by actually parsing the binary data in the URLStream that it uses to load the images and can identify very early in the loading process the type and the size of the image being loaded (since that information is available in the first few bytes of the incoming data). Moreover it also includes an api for immediately canceling the load process so that you can jump to the next image in the list of images you are loading. The API looks something like this:

 

var loader:SuperLoader = new SuperLoader();
loader.addEventListener(SuperLoaderEvent.IMAGE_TYPE_IDENTIFIED, 
                                          onImageTypeIdentified)
loader.addEventListener(SuperLoaderEvent.IMAGE_SIZE_IDENTIFIED,
                                               onImageSizeIdentified);
loader.addEventListener(SuperLoaderEvent.LOAD_COMPLETE, onLoadComplete);

private function onImageTypeIdentified(event:SuperLoaderEvent):void{
  trace(loader.imageType)
}

private function onImageSizeIdentified(event:SuperLoaderEvent):void{
  if(loader.imageWidth < 20 || loader.imageHeight < 20){
   loader.abort();
  }
}

private function onLoadComplete(event:SuperLoaderEvent):void{
  var image:Loader = new Loader();
  addChild(image)
  image.loadBytes(loader.data)
}

The library also includes a SuperLoaderQueue object to manage the load process of multiple images.

The library is released under the MIT open source license and is available on Github.

 

Standard
Air, Android, iOS

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?

Standard
Android, iOS, Miscellaneous, User Experience

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.

Standard
Android

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.

Standard
Android, iOS

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?

Standard
Miscellaneous

Doodler

I am a chronic doodler, and have always struggled to keep my notebooks clear of doodles and seem more “information heavy”. So watching this video was quite an eye opener:

Another link from Time here goes deeper into a study that shows how doodling actually helps you pay attention!

If you really enjoy doodling, I strongly recommend Doodler’s Anonymous, pretty much the definitive blog on doodling. Their post on Netflix Envelope Doodles is just amazing and on my permanent list on links for when I need some creative inspiration.


Netflix Envelope Doodles“This movie sucked.” – is my favorite. I’ll draw something up and add to this fun collection. I like Jovino’s robot too. Reminds me of a killer cyborg version of a British postbox! :D I wonder what would happen if an envelope was to be intentionally placed where a phone-doodler could find it and absentmindedly cover it up with subconscious doodles…

Embedly Powered


Pity the doodle.com domain is owned by a web app that has nothing to do with doodling in the artistic sense (but still a fantastic app that I use quite often). Would love to see Quasimondo’s ScribberToo app there :)

Standard
EspressoReader

Its comments like these …

…that keep me working on EspressoReader

I know this video was posted a year back. Could not stop myself from praising about your marvelous work. Really made my Google Reader mess an enjoyable read.
Thanks and congrats for the awesome piece of software :)

On the first “sneak peek” video of EspressoReader posted July of last year. Wow cant believe its been that long already. Since then it has had about 5 releases with feature updates and yet that pipeline never seems to get emptier ;)

Standard
Miscellaneous

The wrong metrics

The world lost a creative genius yesterday with the passing of Steve Jobs. While there have already been a number of posts on the web on his vision and creative leadership which is how most of us will remember him, it reminded me of how we often measure things in life. This post basically came out of some of those thoughts as well as a fantastic post today by Frank Eliason formerly of @comcastcares fame. One part that really resonated with me is quoted below:

People are focusing on the completely wrong metrics and not properly educating executives on the real story of social media. Today, companies are focusing on metrics such as ‘likes,’ fans, followers, etc. These metrics tell you nothing of substance … Most companies proclaim to be ‘listening’ in the space but very few have changed or implement processes or products based on this listening.

While the post is very specific about social media, I often feel surrounded by metrics that have very little meaning. Often these become goals rather than indicators of value. Developer conversations often revolve around lines of code and code coverage by unit tests and yet these metrics can often be meaningless (like having a 80% code coverage means little if the most fragile parts of the code are ignored). Product conversations revolve around “likes on a Facebook fan page” or “number of tweets” which drive decisions. Career successes are measured not by what we have grown to be able to do but by the title and position we have at the company.

A very common quote in the management is “you can’t manage what you don’t measure” and yet often in the zeal to measure things, we often forget the Observer Effect which, stated simply, says that the act of observing something changes the properties of what’s being observed.

The thing I admired most about Steve Jobs and Apple was their ability to build truly innovative products, of taking risks and going with the heart even when metrics didn’t really exist to predict if they would be successful.

Sometimes all it takes is working on things you feel passionate about.

“Being the richest man in the cemetery doesn’t matter to me … Going to bed at night, saying we’ve done something wonderful… that’s what matters to me.” -Steve Jobs

Standard
User Experience

On Better Printers

After another fairly annoying morning with my printer, I was reminded of this satirical post that the Onion ran on Tim Cook and Printers. The premise of this was basically that printers were as dull as a topic anyone could think of (basically emphasizing the difference between the creative Steve Jobs and the very operationally centric Tim Cook)

New Apple CEO Tim Cook: ‘I’m Thinking Printers’

SAN FRANCISCO-Following the resignation of Apple founder Steve Jobs, incoming CEO Tim Cook called a meeting of shareholders and members of the press Thursday morning to announce that he envisioned printers as the company’s future. “Laser, ink-jet, double-sided, color, black-and-white-the future of technology is in printers.
img

And yet I really do think printers need their “ipod” moment. We have for far too long been stuck with a purely utilitarian implementation that is a cause of frustration more often than not. Anyone remember this sketch by Eddie Izzard?

So I really like this printer concept that I saw last week. This may of course be overkill, but I can’t wait till I have a printer that actually is joyous to use.

Of course I feel the days of the printer may be numbered. I hardly ever use mine except to occasionally print boarding passes for the few airlines that dont yet generate emails with those as QR codes, but still if I do have to have one, I want one of those :)

Update:

Meanwhile there are folks at Bergcloud who are completely reimagining printers more as a toy.

Hello Little Printer, available 2012 from BERG on Vimeo.

Standard