Under The BridgeUnder The Bridge

Musings
HTML5 Intro

So you’ve no doubt noticed references here and there to the nifty new HTML5 stuff that’s working its way out into the world, but there’s been a positive dearth of good introductions out there, as opposed to snippets trickling out here and there; well, here’s a good start on sorting that from our friends at Google:

Video Introduction to HTML5

We’ve put together an educational Introduction to HTML 5 video that goes over many of the major aspects of this new standard, including:

  • Web vector graphics with the Canvas tag and Scalable Vector Graphics (SVG)
  • The Geolocation API
  • HTML 5 Video
  • The HTML 5 Database and Application Cache
  • Web workers

In the video we also crack open the HTML 5 YouTube Video prototype to show you some of the new HTML 5 tags, such as nav, article, etc. It’s chock full of demos and sample source code.

Well worth the watch. Especially in light of the news that Google is going to drag Internet Explorer users kicking and screaming into the current millennium by, essentially, delivering WebKit as an IE plugin. They must be feeling pretty nervous down in Redmond these days!

Library: 3D Globe

Here’s an interesting — if somewhat niche — licensable library just released for your iPhone programming: an interactive 3D globe!

Some of the features of the globe are:

  • Zooming and navigation of the globe with standard iPhone gestures
  • Smooth rotation between two sets of GPS points
  • Multiple high resolution texture maps of the globe
  • Textures that shows country borders and names
  • Adding effects on the globe at a given set of gps coordinates. This can be a glowing effect or drop pins like on a travel map
  • Code is well comment and structure so that it is easy to extend
  • Ability to double tap on the screen and have the code translate the tap into the GPS coordinates of that location

Just the thing if you need it, indeed. Not that one often does we suppose, but hey speaking for ourselves one of these days if we ever find the time to do that iPhone client for mosttraveledpeople.com we’ve been tossing around the idea of doing, we’d definitely look into this 3D Globe thingy some more. In the meantime, there’s a free app available to show the globe in action, an iPhone interface to what looks like a most fascinating travel website that we had not previously been aware of, localyte.com.

Planning a trip? Find local help in 165 countries! Ask Questions. Book Services…

We created Localyte.com because many of the best travel experiences start with getting to know a local person like you.

Localyte.com brings travelers and Localytes together to promote authentic travel experiences….

Localytes are local people who are proud of where they live and want to share their local knowledge with Travelers.

As it happens, we’ve just been contemplating taking a break in the nearish future, and this certainly does look like an interesting site to look into in more depth. So if you are interested in either traveling or becoming one of their localytes, or just want to check out how 3D Globe performs … hey, the app is free!

PocketSherpa

Source: iPhoneDevCamp 3

Here’s a good selection of open source that we’d missed ’til now: Several of the winning projects from iPhoneDevCamp 3’s Hackathon have their source available online. Stuff like:

iPhone ARKit

An open source ui library for displaying location based data in spherical coordinate systems mirroring UI Kit on the phone. A list of CLLocation objects can be submitted and our library will handle drawing of the locations on screen.

OpenFlow: a CoverFlow API replacement for the iPhone

A free, open source replacement for Apple’s private CoverFlow API. The initial release is simple, but it is also efficient and very fast, even on first generation iPhones.

Avatar Wall

AvatarWall recreates the experience of the WWDC App Wall using the Twitter avatars of iPhoneDevCamp followers, and whenever one of them posts a tweet, their icon pulsates to help you more easily identify the source of the latest banter.

Lots more too

Tip: First Responder

So you ever found yourself thinking “gee, it would be really handy to know what the first responder is right now” and wonder why you couldn’t find what must be the quite obvious call to get it? Well, we did, and it turns out no, there actually is no supported way to do it far as we can tell. But if you really really need to figure it out, Matt Gallagher is on the job:

This is an important piece of information, so it’s strange that Apple didn’t choose to provide a public method to access it. Curiously, there is a method, firstResponder, on UIWindow which returns this value but it isn’t public. This will work:

Now, you do have the UIResponder isFirstResponder method publicly available if you want to query about a specific view you know about, but the generic case, nope. Most likely because arbitrary access would get you closer to the dreaded “There is no documentation for the custom subclasses or self-contained views of…” rejection notice, I suppose. But hey, if you want to know how, there you go.
Also of note in that article is code for finding the keyboard, drawing round rects, and providing a nice-looking progress view; good stuff all!

Roundup: Push And Purchase

[EDIT: Discontinued, all except Urban Airship.]

(Alright, this isn’t a “roundup” as we post this, since it’s pretty much just the links from this fine, fine post at NSCoriolisBlog — but hey, we’ll be editing as developments occur!)

So as you’ve noticed no doubt if you’ve even cursorily looked at how to go about implementing push notifications or in-app purchasing in your sparkly new cutting-edge iPhone apps … there’s a lot to do there. More importantly, you can’t just toss your binary up to Apple and forget about it any more, there’s ongoing service and scalability issues. That’s a pretty big leap in project complexity. However, there are services that are springing up to take care of the hassles for you! The two that are actively deployed and providing push and purchase both are

Urban Airship — got all the big name clients so far

iLime — make a big production about being cheaper for messages

Both charge 5 cents a download for content, it seems.

As well, there’s several upcoming competitors in beta:

Bigcurl HTTPush

push.io

iPushServer

msgpush

[EDIT: AppNotify — thanks, Josh!]

Seems like a few too many gearing up there for what the size of the market is likely to be. So although in line with the programmer’s natural desire to avoid work we thoroughly recommend getting started with one of these services, we suspect that if we actually ended up depending for our livelihood on a particular product we’d want to go through the trouble of getting our own host set up to remove this possible point of failure, at least unless/until one of them is clearly profitable enough to stick around for the long term. And so, here’s some links to help you out with that:

Tutorial on how to setup your own server in PHP

Source code (in PHP), requires PHP with memcache

Python wrapper for Apple Push Notification Service

Apple Push Notification Library for Haskell

Apple Push Notification Library for Ruby

Apple Push Notification & Feedback Services Client C# Library

And again, our grateful acknowledgement to NSCoriolisBlog for providing all the links for the first edition of this “roundup”!

More Accessory Development

Here’s a few more handy links for hardware accessory development outside the official program to go along with the headphone connector modem we mentioned earlier:

iPhone/iTouch Serial Port Tutorial

Dock Connector Breakout Board

A Portable User-Space Bluetooth Stack

Let us know if there’s any other happy hacking stuff floating around we could list here!

h/t: iphonesdk!

Creative nib tricks

Here’s an interesting read on creative exploitation of nib file binding behavior. Specifically, to load UITableViewCell instances:

This is what confused me at first:

   if (cell == nil) {

   [[NSBundle mainBundle] loadNibNamed:@”TVCell” owner:self options:nil];

   cell = tvCell;

   self.tvCell = nil;

   }

The method loadNibNamed:owner:options returns an NSArray with the contents of the nib, but this code completely ignores that array. It doesn’t even capture it. Then, it goes on and blithely assigns some instance variable to another instance variable, and then sets the first instance variable to nil.

Yes, that does indeed look unintuitive, does it not?

Then it dawned on me. The bundle loader automatically connects outlets made to File’s Owner when it loads a nib file if the outlet is nil. Notice that when the nib is loaded, the code specifies self as the bundle’s owner. So, since this controller class is the File’s Owner, when we load the nib, the outlet will get connected to an object in the nib if the outlet with that name on File’s Owner is connected to an object in the nib…

That’s just brilliant. Kudos to whomever at Apple thought of it.

We think we’d go more with “sadistically twisted” than “brilliant” per se — that’s what anyone tasked with maintaining your code would think, almost certainly — but it certainly is creative, yes. Try it out yourself … for enhancing job security, if nothing else!

h/t: 71^2!

UPDATE:

If you decide to use this strategy, be warned that you need to set the identifier in InterfaceBuilder to match the table’s reuse identifier — otherwise you will allocate a new instance for every row! Link to article with details can be found here.

Play MPE Player

Ah yes, another excellent Trollwerks project has hit the App Store: Destiny Media Technologies‘ Play MPE® Player, the iPhone version of the desktop client for the Play MPE secure music distribution system!

PlayMPEplaying.png

And we’ve been waiting to tell you that news for a looooong time now. “How loooong a time”, you ask? Why, let us tell you how long! The binary that hit the App Store this afternoon was submitted on May 9th. How long is that? That’s 130 days. ONE HUNDRED AND THIRTY DAYS. 18 weeks. 3120 hours. 187,200 minutes. 11,232,000 seconds. And not a single word of feedback anywhere in that ONE HUNDRED AND THIRTY DAYS except from the trained parrot that Apple has warbling “Your application is requiring unexpected time for review! Your application is requiring unexpected time for review! Awrk! Squawk!” in response to every attempt at opening some kind of communication channel.

Not that we’re bitter or anything, mind you. All’s well that ends well … eventually. But it certainly would be nice to have just a smidgen more transparency to this process wouldn’t it? But hey, it could be worse, they could have actually found something wrong in my code!

Any-ways, if you’re not aware of the Play MPE system already, chances are this isn’t for you; but if you are in it, you want to go get this RIGHT NOW to get at all your prerelease music on your iPhone!

App Store

MonoTouch

[EDIT: Discontinued.]

And continuing our theme from yesterday of things to be vaguely aware of but not get overly excited about, in case you didn’t read any news today, now — the joy! — porting .NET apps to the iPhone just got a lot easier:

Mono developers have shrunk their open-source implementation of the .NET runtime down to iPhone size. Novell on Monday unfurled MonoTouch, a commercial toolkit that allows developers to use Microsoft’s development framework to build apps for Apple’s ubiquitous mobile.

MonoTouch consists of a suite of compilers, libraries, and tools for integrating with the iPhone and iPod Touch SDK. It lets developers use C# and other .NET programming languages for the Apple devices, rather than wading into C and Objective-C…

Indeed. Whilst one’s natural reaction is “come on in guys, the water’s fine” or perhaps “that’s ok, we like our pool clean” (we kid! we kid!) there’s always the possibility, hard though this is to imagine, that there could be something worthwhile written in .NET one might want to port to the iPhone. Or that you’re developing something which has a requirement to run natively on Windows. In which case … hey, this would be handy to know about!

h/t: 71^2!

Authoring: GameSalad

If you’re the type to be interested in cross-platform authoring tools like Torque and Unity, here’s another option for you to check out: GameSalad!

GameSalad is the world’s most advanced game development tool for non-programmers. From an easy to use logic and physics system, to a visual based interface, and even the means to share your games to the iPhone, Desktop, and Web – GameSalad provides everything you need to get your game from concept to execution. Simply download the tool to a your Mac, install, and start making games!

Indeed. Good luck with that. But hey, it does look more Mac-centric than the more established competitors, which is always a good thing, and if your ideas really are that simple, perchance this could be an option. This little note and lingering vague awareness of its existence are about as far as we plan to get involved … but hey, if you actually try it out, we’re certainly interested in hearing your opinion!

h/t: ipodnn!