Photo Printing on Android


I always find it interesting to watch the 4x100m Sprint Relay at the Olympics and Track and Field Championships. It’s the fastest and most technically difficult of all the relays. Demonstrating true synergy, a well executed relay transports the baton around the track faster than the sum of the individual personal best 100m times.

Synergy is usually defined as the interaction or cooperation of two or more agents to produce a combined effect, greater than the sum of their separate effects. Aristotle of course was more concise; “The whole is more than the sum of its parts.”
When several applications work closely together, synergism can also be observed on Android. Android introduced the powerful yet simple concept of Intents, a facility to perform late runtime binding inside and even between applications.

Android applications expose their Activities and related Intents-Filters through the AndroidManifest.xml, and Activities implicitly or explicitly set to exportable can be used by other applications. HP iPrintPhoto for instance invites other applications to use its PRINT Action, by declaring the following Activity in its AndroidManifest:

Application that like to use the image printing feature provided by iPrint Photo, would create and new Intent and start the print Activity, like so:

The example above assumed that an Uri to an image already existed. If that’s not the case, and for instance the content of a Canvas needed to be printed, then the Uri could easily be created on the fly:

While all Android applications expose at least their launch Activity, some go a step further, and by marking Activities as exportable, allowing them to be called from other applications. HP iPrint Photo has gone the extra mile. Not only is its print Activity exported, but by explicitly choosing a vendor-neutral name for the Print Action “org.androidprinting.intent.action.PRINT”, the door is kept wide open for other printer vendors to join-in, using the same name to allow printing to their printers as well, which in turn would make printing applications vendor independent.
A good place to learn about available Activities and how to correctly create the Intents to start them, is the OpenIntents registry.
Besides enabling synergism on the application level, Android demonstrates mobility, skill, and more recently an almost explosive speed, which are the predominant requirements for a successful decathlete. The decathlon is another interesting highlight at Track and Field Championships, I love to watch. It’s a supreme test, whose champion may claim the title “world’s greatest athlete.”

 

 

Leave a Reply