Wednesday, September 17, 2008

Netflix API - Getting OAuth to work on iPhone - part 2: Adding the OAuth Code

To start with I found some examples by Nick Dalton that helped me build a simple application that included a Web View, a screen that acts like a web browser but with my custom Objective-C code embedded in it. This is important, because the OAuth sign-in process uses a web page, but on the iPhone, if you spawn a copy of Safari to visit a web page, your application quits first.

Next the Source Code Manager in Xcode was configured to load the OAuthconsumer Objective-C framework via subversion. This was easy and obvious, enter the URL http://oauth.googlecode.com/svn/code/obj-c/ and checkout the code.

When trying to import the framework I discovered that Apple does not allow user specified binary frameworks to be added to iPhone applications. To work around this the source code was copied from the Xcode project for the framework, to the Xcode project for my Instant Test application. I renamed the  framework Classes folder as OAuth and copied to my project via drag and drop, choosing to copy the underlying files. The Cocoa Categories, Protocols and Other Sources>Crypto folder were also copied. The Tests folder did not compile for iPhone so don't bother to copy it over.

The standard system Security.Framework doesn't need to be added to the Frameworks folder. I initially thought it did, but its probably only needed for the KeyChain code.

The iPhone doesn't support the KeyChain functionality, so if you try to build for iPhone it will fail. It does however build for the iPhone Simulator, which is confusing. Open up the OAuth source code, and delete the last two files OAToken_KeychainExtensions.h and OAToken_KeychainExtensions.m.

Since the code is no longer a framework, the header file references need to be changed from #include to #include "file" for all the includes in OAuthConsumer.h apart from the first Foundation one.

At this point, before you try and call anything, try a build, it should compile with no errors. If it doesn't, look for missing files.

At this point, you should have all you need to connect to an OAuth service

Tuesday, September 16, 2008

Netflix API Getting OAuth to work on iPhone - Instant Queue Add part 1: why?

Why develop an iPhone app? Its "the future", a useful skill, and I can carry whatever I develop in my pocket and make it do whatever I want.

I work at Netflix, and I have instant watching on my TV, I built an application "Instant Queue Add" that lets me add a title to my instant queue using my iPhone in a couple of touches. It takes the Top20 and New Choices RSS feeds to find content, and it spawns a copy of Safari to add to instant queue for each pick. The first time it starts, you have to login, then it remembers the Netflix cookie. However I really want to add more features and avoid spawning a copy of Safari with a screen scraped URL.

The Netflix API uses a new standard called OAuth for Open Authentication. There are lots of features, but its complex, and there is no standard off the shelf library for OAuth on the iPhone. However it is a useful building block for more advanced applications.

In this series of posts, I will document the steps I'm making to get OAuth to work on the iPhone using Objective-C and Xcode. My starting point is this code base and tutorial by Jon R. Crosby, which is based on desktop MacOS X, and doesn't directly support the iPhone.

Monday, September 8, 2008

Intel high speed SSD

Here is Tech Report's review of Intel's high speed SSD, which confirms the trend I've been talking about for a while. SSD's were always faster for random read and write, now they are faster for sequential read (250MB/s), and the "extreme" Intel model is faster for sequential write as well (170MB/s). They use less power and have comparable MTBF to the best enterprise disk drives.

The remaining disadvantages of total size and cost are being eaten away over time...

Wednesday, August 6, 2008

The Physical Web

Nat Torkington on O'Reilly Radar declares a familiar theme...

The next step for computing is to move out from the computers. Every device has the potential to become network-connected, delivering information to or from a web service. The mobile phones in our pockets also let us take apps and network service with us wherever we go. Early hackers are building in this space. Big challenges include: take products to the masses and the environmental impacts. We're at early stages yet, but the room for expansion is huge. Projects to watch include Nokia's reinvention as services company, iPhone, and Google's Android platform.

Thursday, July 24, 2008

Consumer grade Flash in an SSD package - WAIF

RegHardware mentions Raidon's Compact Flash in a 2.5" SATA disk form factor which can be loaded up with cheap CF cards (32 Gig for $100 at the time of writing). The Raidon package holds two CF cards which can be mirrored for safety, or striped/concatenated (its not clear which) using "NRAID" which doesn't require both CF cards to be the same size.

I'd like to see a similar concept go even further using microSDHC, it should be possible to get a Wide Array of Inexpensive Flash (WAIF) based drive with consumer based pricing and very high storage capacity and bandwidth. Its going to be appropriate for read-mostly workloads such as personal use in laptops, static content web serving and archival storage.

Tuesday, July 8, 2008

Next-Generation Mobile Broadband - The 4G Summit at PARC

There is a talk at Xerox PARC next week sponsored by the Wireless Communications Alliance. They don't have URL's that link to specific events so here is the full description, currently listed on their site. Unfortunately I have a work commitment so I can't attend, they do mention many of the very advanced ideas that I have been talking about in my Millicomputing talks, such as video conferencing over high bandwidth mobile networks.

Tuesday, July 15th 2008, 4:00pm - 6:00pm
WCA CenterStage presents: Next-Generation Mobile Broadband - The 4G Summit
Venue: Palo Alto Research Center, Palo Alto CA

-- Moderator: Iain Gillott, Founder & President, iGR Inc.

-- Jake MacLeod, Principal Vice President & CTO, Bechtel
-- Barry Davis, Exec Director of Products & Services, Clearwire
-- Jim Orr, Principal Network Architect, Fujitsu Network Communications
-- Jon Hambidge, EVP & Chief Marketing Officer, NextWave Wireless
-- Samir Khazaka, Sr Director Technical Marketing, QUALCOMM
-- Gennady Sirota, VP Product Management, Starent
-- Lee Tjio, Director of Advanced Technology & Strategy, Verizon Wireless

Visionaries who speak about fourth-generation mobile technology (aka 4G) often allude to the tantalizing promise of services and features previously found only in science fiction; interactive holographic video, handheld devices with high-resolution (better than HDTV) images, streaming HD video conferencing and real-time interaction while mobile. 4G also promises a convergence between technologies, for example; mobile payments using near-field communications and handset-based smart cards, personal assistant technologies in which your mobile device will interact with networked devices and services based on your location/schedule/current actions/etc. Implementing the 4G vision of the future will require a bandwidth of at least 100Mbps, which has implications for spectrum policy not supported by current licensing and bandplans.

It's generally accepted that 4G will run over an IP infrastructure, will interoperate with 802.xx technologies (Wi-Fi, WiMAX, Bluetooth, ZigBee, etc), and will need to support data-rates from 100Mbps to as high as 1Gbps. It's also expected that 4G will be a collection of technologies and protocols; versus one single standard. There are at last three major camps (and a few upstarts) that aspire to be the major 4G mobile data service provider and have a dominant influence at defining the mobile broadband market for decades to come. Will it be one of the major camps, or will there be a dark horse that emerges?

On July 15th 2008 the Wireless Communication Alliance CenterStage will proudly present "Next-Generation Mobile Broadband : The 4G Summit". Stakeholders from various camps around the 4G battleground will come together under a flag of truce to debate the strengths and weaknesses of the approach on which they're betting. What's real, and what's simply hype? Who will be the first to achieve 4G ratification, and when is a realistic date when this will happen? What are the implications for technology vendors, service providers, and content developers? Are there any non-Western standards also likely to be contenders? How will the industry address spectrum licensing challenges and bandplans which today would seem to favor FDD versus TDD technologies? How will spectral refarming, cognitive radio, and spectrum-sharing technologies affect the market? Given that the evolution of technology demands that existing 3G systems will have to co-exist with future 4G systems; how will that transition take place and are there business opportunities in helping to facilitate that transition?

Insights, information, and understanding will be the take-aways from this exciting WCA event. How can you afford to not be there? Mark your calendar for July 15th 2008 and plan to attend! We expect this event to sell out, so to ensure your seat we recommend that you register now for this event.

Cost: $20 at the door, $15 in advance via PayPal/Credit Card

Wonderland - Immersive Virtual World

Interesting discussion of Sun's Wonderland project. Of particular interest is that they are using attenuation and stereo audio to place voices in space, so as you move around people come into earshot. Its also an open source project, and this is the kind of audio interface I've been discussing for a while.