Wednesday, April 7th, 2010

AdLib: PastryKit for the tablet?

Category: Apple

<p>

We heard a little about PastryKit, a cool library from Apple that makes great iPhone apps using the Web. Now we see the mysterious AdLib which seems to be similar but gives you goodness on the iPad instead.

Jim Hoskins checked it out:

Curiosity got the best of me, so I loaded the page in Safari on my laptop (and changed Safari’s user agent to mimic the iPad) and got to work with the developer tools. After extracting the JavaScript and de-minifying it, my suspicions were confirmed. Apple was manually reading the touch events, calculating the inertia of the scrolling, and manually drawing the scroll bars. It was incredible that it worked so smoothly in the browser.

What was more interesting is that there was an entire framework running this web application. The framework weighed in at 4,300 lines of code, and was unmistakably an Apple-born API. Every class and constant was prefixed with the letters “AD” and some of the classes include ADTabBarController, ADScrollPane, ADViewController, ADView, ADToolbar, and dozens more.

What does the AD prefix stand for? I don’t know. The framework itself was contained in a file called AdLib-ug-ipad.js, so for the time being let’s call it AdLib. I also appreciate the sense of humor the developers seem to have about the name. The accompanying application code that utilizes the framework is about 1,500 lines and offers a few clues as to how to use the AdLib framework. There is no documentation in the code or anywhere online, and the local variables are shortened to a, b, c, etc… If you want to know more about how it works, take a look at the code linked below.

And with the simple stuff, Jason Grigsby has a posting that shows simple CSS for handling portrait and lanscape via:

  1. <link rel=”stylesheet” media=”all and (orientation:portrait)href=”portrait.css”>
  2. </link><link rel=”stylesheet” media=”all and (orientation:landscape)href=”landscape.css”>

Cappucinno, SproutCore, Coherent, PastryKit, AdLib, ….. a lot of interesting apple-y things.

Posted by Dion Almaer at 4:24 pm
2 Comments

+++--
3.7 rating from 10 votes

2 Comments »

Comments feed TrackBack URI

AD – Apple Device ? Makes sense, but a tab boring.

Comment by Jagged — April 7, 2010

Today’s announcement of iAd platform would explain why this library is called AdLib. They may be planning to use it for showing units that functioned like mini-apps within apps offering a host of interactive options” and what “Jobs emphasized that the ads were created with HTML5, the latest version of HTML Apple” and “.

Comment by ChiragNirmal — April 9, 2010

Leave a comment

You must be logged in to post a comment.