2011年6月5日 星期日

IMAP4 : The mobile application protocol we didn?t know we had

By Brian McConnell Jun. 5, 2011, 12:03pm PT No Comments

IMAP4 (Internet Mail Access Protocol) is a little discussed but widely used protocol for accessing and managing email. As it turns out, IMAP is also a great way to deliver information to mobile applications, by repurposing mobile IMAP clients for use in a wide range of mobile applications. While this is a bit of a hack, since we?re using a protocol designed for one purpose for an unintended use, it solves several problems that plague mobile applications.

IMAP is designed to do one thing and do it well ? deliver email despite the intermittent connections that were prevalent when it was developed. For that reason is baked into nearly every email client and mobile device. Email delivery is also one of the most thoroughly tested services on mobile devices, and is designed to operate as an always on, background service.

IMAP was designed at a time when mobile Internet apps did not exist, and when most Internet connections were dialup connections. As with mobile apps running on cellular networks, email clients of the time needed to make best use of the intermittent connection they had. Without going into too much detail, IMAP splits accessing an email account into several tasks:

  1. Logging in and retrieving a list of folders (inbox, outbox, etc)
  2. Retrieving a summary of messages within a folder, but not the messages themselves
  3. Retrieving an individual message and/or attachments

This approach enables the mail client to quickly find out what?s in a mailbox, and then retrieve the messages needed, without retransmitting information that is not needed or that has been sent before. This maps nicely to what many mobile apps do, and can be optimized in the same way.

In this paradigm, an information service presents an IMAP interface that email clients can connect to. Let?s use an upcoming event notification service as an example, and walk through the steps an IMAP client would use to display continuously updated event information tied to your current location. The client would go through the following steps:

  1. Login with the user?s credentials, request a list of folders. The server replies with a list of folders such as ?San Francisco : Mission?, ?San Francisco : Civic Center?, and so on.
  2. The client subscribes to some of all of these folders, and fetches a list of message headers. The message headers contain basic information about upcoming events. IMAP?s server side search function will also be a useful way to fetch customized result sets.
  3. The client fetches message bodies and attachments in the background, or when the
    user opens an item, depending on how the email client is configured.
  4. When the user opens a message, he or she sees an HTML formatted email, with links,
    attachments, etc all preloaded, so there is usually no visible network delay because most of the message was preloaded in the background.

Why give IMAP a try?

Of course, you can do all of this with a native application that calls a web service in the background and selectively loads and caches information ahead of time. The problem is that it requires much more work on the part of the developer, and on some mobile platforms, background processes are tricky to manage (e.g. they?ll be shut down by the mobile OS to conserve memory or battery power), whereas using IMAP, one can simply subscribe to additional IMAP email account for the services the user is following. Most mobile email clients also notify the user of new or unread messages, and provide a simple notification mechanism, another bonus. Meanwhile, the service provider can track which users have read which messages, news items, etc.

Another advantage of using IMAP as a transport protocol, and using a built in IMAP agent on the phone, is it is already there, and is one of the core services on mobile devices. Your web app can behave like just another IMAP inbox the device can subscribe to, so it will be synced along with other mail accounts. Likewise, your users can subscribe using their phone?s built in mail client, or you can ?skin? an existing client for look and feel, without forcing your developers to build the whole thing from scratch.

The missing piece.

Most of the pieces needed to do this are already available. The protocol is widely used and is built into nearly every mail app in some form. Only one piece is not widely available, an IMAP2HTTP utility that presents an IMAP interface to mobile apps, while communicating with an upstream web service via RESTful HTTP queries that are easy for web app developers to deal with.

Jesse Vincent?s Perl library, NET::IMAP::SERVER, enables web apps to serve data as IMAP mailboxes. In addition to libraries for popular programming languages, there is an opportunity for mobile development tools vendors, such as Titanium and PhoneGap to host IMAP-to-HTTP gateways that provide a solution for web app developers, much like the SMTP2WEB service enables web apps to process email. (Hint: it would also be nice if Google provided a similar handler for App Engine, much as it has done for inbound email processing and XMPP/Jabber messaging).

IMAP will primarily be useful for applications that continuously retrieve information, such as news readers, background search tools, and similar applications that can present information as a set of items in folders. It is a bit of a hack, but it?s a useful hack that can improve the user experience for many mobile applications. It won?t replace native apps, but will provide developers with a fast and inexpensive way to provide mobile access, and then make a decision about whether to invest in native apps further on in the product development cycle.

Brian McConnell is an entrepreneur, and the founder of the Worldwide Lexicon, an open source translation platform. Prior to founding WWL, he founded several telecom and mobile startups (where the balkanization of the mobile software industry was one of his biggest pet peeves).

Related content from GigaOM Pro (subscription req?d):

loading external resource{"source":"http:\/\/gigaom.com\/wijax\/4105698c8625337c88a1ce0943c2fbfc","varname":"wijax_9ff57ae9a8435c6431dc154870b85b32","title_element":"div","title_class":"widget-title-wrap clearfix","title_before":"%3Cdiv%20class%3D%22widget-title-wrap%20clearfix%22%3E%3Cdiv%20class%3D%22widget-title%22%3E","title_after":"%3C%2Fdiv%3E%3C%2Fdiv%3E"}
loading external resource{"source":"http:\/\/gigaom.com\/wijax\/1d207d73ee8c81b92ad4f0347faf734a","varname":"wijax_1d5fccb3ee7d6e275fcbaf4ef9be5c33","title_element":"div","title_class":"widget-title-wrap clearfix","title_before":"%3Cdiv%20class%3D%22widget-title-wrap%20clearfix%22%3E%3Cdiv%20class%3D%22widget-title%22%3E","title_after":"%3C%2Fdiv%3E%3C%2Fdiv%3E"}
loading external resource{"source":"http:\/\/gigaom.com\/wijax\/cc414a9b98dce90f7348102ee0cff081","varname":"wijax_9052ad44be8ae5c31d73e12ac199f7ab","title_element":"div","title_class":"widget-title-wrap clearfix","title_before":"%3Cdiv%20class%3D%22widget-title-wrap%20clearfix%22%3E%3Cdiv%20class%3D%22widget-title%22%3E","title_after":"%3C%2Fdiv%3E%3C%2Fdiv%3E"}
loading external resource{"source":"http:\/\/gigaom.com\/wijax\/1b341377f96d1d562509f945f46cbca2","varname":"wijax_0131d81e7ae6ff6530a29c1fbbf7de6e","title_element":"div","title_class":"widget-title-wrap clearfix","title_before":"%3Cdiv%20class%3D%22widget-title-wrap%20clearfix%22%3E%3Cdiv%20class%3D%22widget-title%22%3E","title_after":"%3C%2Fdiv%3E%3C%2Fdiv%3E"}
loading external resource{"source":"http:\/\/gigaom.com\/wijax\/f549bff346cfee2feadb363f6c5438d4","varname":"wijax_8e5787402529dfb1d483b399af86f6f7","title_element":"div","title_class":"widget-title-wrap clearfix","title_before":"%3Cdiv%20class%3D%22widget-title-wrap%20clearfix%22%3E%3Cdiv%20class%3D%22widget-title%22%3E","title_after":"%3C%2Fdiv%3E%3C%2Fdiv%3E"}
loading external resource{"source":"http:\/\/gigaom.com\/wijax\/50cde7d40bf80573e9056f1498b2b9ba","varname":"wijax_527dfb251ef140af76d62a2a8eb967a3","title_element":"div","title_class":"widget-title-wrap clearfix","title_before":"%3Cdiv%20class%3D%22widget-title-wrap%20clearfix%22%3E%3Cdiv%20class%3D%22widget-title%22%3E","title_after":"%3C%2Fdiv%3E%3C%2Fdiv%3E"}
loading external resource{"source":"http:\/\/gigaom.com\/wijax\/eeb89169508f77bc45b5cd5cd6dbfaee","varname":"wijax_a4c196ff2b94266246b4224a9e4d61f5","title_element":"div","title_class":"widget-title-wrap clearfix","title_before":"%3Cdiv%20class%3D%22widget-title-wrap%20clearfix%22%3E%3Cdiv%20class%3D%22widget-title%22%3E","title_after":"%3C%2Fdiv%3E%3C%2Fdiv%3E"}
loading external resource{"source":"http:\/\/gigaom.com\/wijax\/1d47b26366a20f0449c62230aa7affdc","varname":"wijax_d3c47a62f7bdac096b94bc7a80832825","title_element":"div","title_class":"widget-title-wrap clearfix","title_before":"%3Cdiv%20class%3D%22widget-title-wrap%20clearfix%22%3E%3Cdiv%20class%3D%22widget-title%22%3E","title_after":"%3C%2Fdiv%3E%3C%2Fdiv%3E"}

Source: http://gigaom.com/2011/06/05/imap4-the-mobile-application-protocol-we-didn%e2%80%99t-know-we-had/

アイフォーン4g virizon wireless ytube movies tower defencew

沒有留言:

張貼留言