Adobe AIR iOS Case Study Slides from Presentation at fcny/nycoders.org May 9,2012
I gave a talk with Joe Ferrari, my co-conspirator on a pretty complicated iPad app that we built with Adobe AIR 3.2 in just 8 weeks. Joe doing most of the work, and we had some help from another dev as well. It was a small but appreciative audience. I personally love to see case studies and would like to see more of them.
The app has confidential client stuff so I can’t show or talk about any of that, but we can share our slides from the presentation. I’ll update this post later with some helpful links that I haven’t had time to organize.
Fix for Keynote File Corruption
Keynote users all too often get a terrifying message “This isn’t a valid keynote document” and are then screwed, having no way to open or fix their toiled-upon Keynote presentations. This happened to my wife last night and it took me a while to track down the answer, which is pretty straightforward.
If you get this issue, don’t worry! The answer is described perfectly here:
http://www.andreadenaro.com/a-must-know-tip-for-apple-keynote-users-corru
Hopefully this post will make it a little easier to find this information.
And, boo to Apple for not fixing this glaring hideous bug.
Setting up Your HTML5 Animation Loop
Went to a great talk last night at the Eyebeam Center given by some of the Google Data Arts folks: Aaron Koblin, George Michael Brower, and Jono Brandel.
They showed how to set up a scaffolding for playing with Canvas2d and the amazingthree.js. One of the great teachings was how to set up the main animation loop in your HTML5 project.
You can use a timeout, as most people do, but that always felt “tacky” to me. It turns out there is a draft spec for a feature that gives a more natural way to code this: requestAnimationFrame
It’s dead simple to use and makes for much more elegant code. The fallback implementation is to use timeout, so it works on all browsers. Where it is fully implemented however, your app will behave nicely and won’t update when the tab is not visible, which is great!
The code you need has been made available by the always helpful Mr. Doob, in requestAnimationFrame.js
<head>
<script type="text/javascript" src="requestAnimationFrame.js"></script>
<script type="text/javascript">
animate();
function animate() {
// insert your code to update your animation here
requestAnimationFrame(animate);
}
</script>
<body></body>
</html>
This is all that it takes, go nuts kids!
Be aware: you can’t be sure what the resulting frame rate is, it might be 30 fps, 60 fps or something else. But it’s bad practice to program to frame rate anyway, you should always be animating in terms of time.
Paul Irish has a much more in-depth explanation of this approach.
Firefox 4 + Flash, WTF?
My Firefox was updated to 4.0.1 at work, against my will, which broke many of my installed plug-ins, and introduced me to this new annoyance:
Flash plugin has died, Again!
I researched and found that they introduced a new feature in Firefox 4 intended to protect Flash from crashing the whole browser. This is laudable, but I find that the Flash Plugin (debugger) has become so unreliable that I’ve had to switch to Chrome if I want to look at any videos or other Flash content.
FlashcodersNY Appcelerator Talk, April 20
On April 20th, Miguel Cordones, Kevin Lockwood and I co-presented on Appcelerator at the weekly flashcodersny meeting. We were discussing the Appcelerator training course we’d just taken a few weeks before, the first to be offered in New York City.
What is Titanium Appcelerator?
Titanium Appcelerator is a platform for making cross-platform native applications (mobile and desktop). You program with Javascript and the technology has a lot of promise. I played with it last year and found it was a super easy way to knock out an simple iPhone app. Unlike the Corona SDK, or Adobe AIR, Appcelerator uses native components. And the appeal is that you can develop your mobile app once and publish to Android/iOS devices from the same code base.
The training was very good, Kevin Whinnery really knows his stuff. It was pretty damn pricey, not sure I’d recommend it if your company wasn’t paying for it. That said, it was worth it to me. One of the main pitfalls of getting started with Appcelerator is that their main sample app, KitchenSink, is a really shitty example of how to structure your code! It’s a great example of how to access all the features of the SDK, and essential for fleshing out details that are not available in the documentation. Otherwise it’s full of things you don’t want to emulate for an app. A much better example is the Tweetanium sample app, which follows standard JS best practices.
Most valuable learning from the training: Appcelerator best practices are Javascript application best practices.
You don’t feel like attending no stinking class? The training materials from the class are available on-line here.
Summary
I’m still not decided on this technology. Appcelerator has a lot of promise and they’re adding features frantically. But, I haven’t had time to get a real app together and go through the whole experience, so I’ll delay judgement until I can do that. But, I do plan to build out an app, and will definitely use this technology for prototypes in the meantime. It’s definitely worth checking out. I know at least one startup, getglue.com, seems to be relying on Appcelerator.
I don’t love their new licensing model (it used to be free, which of course was preferable!), which seems about the same as Corona’s. The company is very sales-driven, and contacting them about anything will lead to some salesperson calling or emailing you, which is really annoying and off-putting.
My slides from the talk (Intro to Appcelerator) as a PDF
Miguel Cordone’s slides (Working with Data), Powerpoint file
Would love to hear other’s experience with the technology.
Programming is Much Harder than Managing!
Have you ever wondered why managers just don’t seem to truly understand the insidious effect of crunch time on programmer productivity? The failure of crunch time is well known, but many people don’t have a visceral sense of this.
Now I know why!
I’m in a dual role at my current job and sometimes I am a hands-off manager, other times an architect. Two of my projects went into the danger zone, in consecutive weeks, and I had to put in an epic day for each. This gave me first-hand experience at what it’s like to have a 14-hour day as a programmer, versus a 14-hour day for a manager in the last 2 weeks.
I can now say from direct experience what I’ve long suspected: A 14-hour day of programming is an order of magnitude more draining than a 14-hour day of management.
After my long day of hacking, me and the other programmer were laughing about how brain-dead we were. Everything took forever, obvious things eluded us, weird things kept tripping us up, and so on. I estimate we were at about 30% productivity, and probably should have been forcibly kept away form the keyboard. I doubt we accomplished much worthwhile that day, and the risk of us making a hash of things was very high.
To give an idea of how pathetically impaired we were, it took me 30 minute to debug an embedded font problem in Flash, that should have taken 2 minutes tops. Can you see the problem here? (I couldn’t!)
On the flipside, after my all-night slog of project management, the next day I was tired. But I was not impaired noticeably, probably 85% of normal.
The skills for management and programming are very different, of course, but the big difference is the level of concentration required.
My dear friend and colleague, the sage Joe Ferrari, said it’s the difference between being a player and a coach. I loathe sports analogies in general, but I think this one is spot on!
In spite of the mythology, all-night heroic programming efforts are almost never technical successes (although they still may be politically worthwhile). You usually end up with crappy code, and burnt out programmers. It should always be understood in these situations that you are stealing productivity from the rest of the week!
Finished Titanium Appcelerator Developer Training
Took the great class, taught by Kevin Whinnery, in NYC on March 28-29th. The test was hard, but I’m now an officially certified Titanium Appcelerator developer! A very worthwhile experience, I will blog about it in more detail soon.
And I’ll be discussing it at flashcodersny later this month.

From the Appcelerator Developer blog:
http://developer.appcelerator.com/blog/2011/04/two-outstanding-classes-in-the-big-apple.html
AS3 Library for Posting to S3 available!
As i discussed in my last post, Adam Balchunas has made his library available on github. This will make your life much easier, believe me, if you want to get started using S3 from Flash!
He also talks about it on his blog.
Posting to Amazon S3 from Flash is EASY (once you find the damn page!)
There’s a ton of useless and misleading information about posting assets from within Flash to the Amazon S3 system. My programmer and I wasted an entire day chasing down rumors, misinformation and wading through a huge pile of confusion before finally finding this page:
http://aws.amazon.com/code/1092
There’s a very straightforward explanation and great code samples. In 20 minutes we knew our approach would work and 3 hours later we were done. For some reason you will not get this page when you Google/Bing “Posting to Amazon S3 from Flash”, even though this is the title of the page! I’m hoping this blog will help bump the correct results.
Adam Balchunas, the programmer, is going to make an even easier to use library based on the code examples from this page. His approach will make easy-peasy to set up Flash to upload arbitrary content to S3 and I’ll post the info as soon as it is available.
MacBook Pro SD Card Slot Read-Only?
Ran into a weird problem over the weekend with the SD card reader on my MacBook Pro. I wanted to copy some files onto one of my 8GB cards, but it showed as read-only. ALL of my cards were now showing as read-only, which I’d never seen before. No matter which way I set the switch on the card, the card showed as read-only, a conumdrum!
Did a little research and found this helpful discussion on Apple’s forum: http://discussions.info.apple.com/message.jspa?messageID=10680584
The approach I found there is ridiculous, but it works:
Set the switch on the card to in-between the read-write positions, and the MacBook Pro will allow you to write the disk.
This never happened before. I’m not sure if it’s my computer getting old, or the recent upgrade to Snow Leopard.
