iOS

Photoillustration of a woman photocopying an iPhone.

Relax, Fandroids. I kid because I care.

Cover of 'Dogfight' by Fred Vogelstein.“As a consumer, I was blown away,” says Googler Chris DeSalvo in a quote from Fred Vogelstein’s book, Dogfight, upon seeing the now-legendary January 9, 2007 Stevenote when he unveiled the first iPhone.

“I wanted one immediately,” DeSalvo continues. “But as a Google engineer, I thought ‘We’re going to have to start over.’

According to the Atlantic article The Day Google Had to ‘Start Over’ on Android, an excerpt from Dogfight, Google’s big concern at the time was Microsoft. It made sense at the time: They seemed to be making the right moves. If you remember those days, Windows Mobile 5.0 was the third revision of their mobile operating system, and true to the general rule about Microsoft revs, it was finally good enough. They’d lined up an impressive array of nearly 50 hardware partners, including HTC, who’d end up shipping the most WinMo phones, and the big coup: Palm, whom they’d convinced to build phones that ran WinMo. Their OS featured mobile versions of Office. The industry rumblings were that Microsoft would end up eating away at the dominant phone OS player at the time, Symbian. “Microsoft comes out fighting when threatened,” the conventional wisdom said. “Remember what happened in the browser wars?”

Here’s what was considered to be the game-changer that would make Microsoft a serious mobile threat: the Palm Treo 700w

Palm Treo 700w phone

The Palm Treo 700w.

The best smartphones of the era followed a design template that had been defined years earlier by the Blackberry: screen at the top, physical keyboard at the bottom, augmented by some kind of device to move the cursor (first a scroll wheel, then a D-pad, and optionally, a stylus).

Then this happened:

(If you haven’t seen it before or in a while, watch it again. You can almost feel the audience’s excitement in the opening moments, as Steve teases them with hints of what he’s about to announce. You can also feel the envy when Google’s Eric Schmidt comes onstage at the 51-minute mark — remember that he was on Apple’s board then.)

From the article:

On the day Jobs announced the iPhone, the director of the Android team, Andy Rubin, was six hundred miles away in Las Vegas, on his way to a meeting with one of the myriad handset makers and carriers that descend on the city for the Consumer Electronics Show. He reacted exactly as DeSalvo predicted. Rubin was so astonished by what Jobs was unveiling that, on his way to a meeting, he had his driver pull over so that he could finish watching the webcast.

“Holy crap,” he said to one of his colleagues in the car. “I guess we’re not going to ship that phone.”

Another key quote, this time from Ethan Beard, one of Android’s early biz dev people:

“We knew that Apple was going to announce a phone. Everyone knew that. We just didn’t think it would be that good.

With the announcement of the iPhone, the Android project, whose members had been working “sixty-tp-eighty-hour weeks for fifteen months — some for more than two years” made a pivot whose effects we’re still feeling today. The BlackBerry-like phone that they’d been working on — codename “Sooner”, with a physical keyboard, no touchscreen, and a general “me-too” design — was pushed aside. They filed mobile phone-related patents galore in September 2007. The iPhone forced them to rethink the OS and phone design, and from that came a new design, codenamed “Dream”. This pivot would require them to delay their first release by a year, and the end result was the HTC Dream, released in October 2008.

HTC Dream phone, shown in landscape mode with the sliding keyboard extended.

The HTC Dream.

As you can see, the Android weren’t so sure about all of Apple’s design decisions, hence the physical keyboard and trackball. Today’s phone designs tell you how those choices by the Android team worked out.

I’ll close with an observation based on the article by John “Daring Fireball” Gruber. He may be Apple’s freelance PR guy, but he’s often right, including in this case:

Remember a few years ago, at the height of the “Android is a ripoff of the iPhone” controversy, when Android supporters claimed that the similarities were just some sort of amazing coincidence, like Newton and Leibniz discovering calculus concurrently, because Android had started life a few years before the iPhone was introduced? Good times.

I’m going to get my paws on a copy of Dogfight and read it over the holidays. Expect a review of it in the coming weeks.

 

{ 0 comments }

weather app

Whether you’re new to iOS programming or a long-timer, RayWenderlich.com is a valuable resource for the iOS developer. They regularly publish tutorials, tips, tricks and other goodies that you’d be crazy to do without if you’re serious about writing apps for iDevices. In addition to articles on the site, they go deeper with their books, which are excellent.

RayWenderlich.com recently published an article titled AFNetworking Crash Course, which covers how to write networking apps using AFNetworking, a library created by the folks at Gowalla that simplifies iOS network programming. In this tutorial, you build a weather app that uses AFNetworking to get its data from the World Weather Online service. Check it out; AFNetworking’s useful, and the tutorial’s pretty nice.

In order to reach the widest possible audience, the tutorial was written for iOS 5 and earlier versions of Xcode. If you’re developing with the current version of Xcode and for iOS 6 (which accounted for 83% of all iOS traffic in North America in February), you might want to make a few changes to the code in the tutorial. I’ve listed the changes below:

Use Modern Array Notation

Here’s the old way to get at the element of an array whose index is theIndex in Objective-C:

It’s a little clunky, and as I wrote in an earlier article, Objective-C’s New NSNumber, NSArray and NSDictionary Syntaxes Mean Less “Yak Shaving” for iOS and OS X Developers, there’s a much nicer way to do it:

In AFNetworking Crash Course, where you see code like this:

change it to this:

Use Modern Dictionary Notation

Here’s the old way to get at the item in a dictionary whose key is theKey:

Again: it’s clunky. Also again, in my earlier article, I showed the modern way to access dictionary items:

Setting items for a dictionary used to be like this:

Now, it’s like this:

So, in the places where you see code like:

change it to:

…and where you see code like:

change it to:

Update the Deprecated Location Manager Delegate Method

If you use the code as-is with iOS 6, you’ll get an error message that looks like this:

Deprecated in iOS 6.0
locationManager:didUpdateToLocation:fromLocation:
Tells the delegate that a new location value is available. (Deprecated in iOS 6.0. Use locationManager:didUpdateLocations: instead.)

Instead of using the deprecated locationManager:didUpdateToLocation:fromLocation: method, use the current locationManager:didUpdateLocations: method instead:

{ 0 comments }

RubyMotion Tutorial

Clay Allsop’s RubyMotion Tutorial appears to be the most complete tutorial on the topic online. If you don’t relish the idea of programming in Objective-C but want to write native iPhone apps, you should check out this tutorial and see if coding apps in Ruby with RubyMotion is for you.

If you’re feeling really ambitious, you can fork the tutorial on GitHub and rewrite or expand upon your own version.

Links

AIDE: Android Java IDE

AIDE, the Android Java IDE, lets you code apps for Android devices on an Android device. It’s fully compatible with Eclipse projects, supports the full edit-compile-run cycle and has an editor with desktop IDE features like code completion, real-time error checking, refactoring and smart code navigation. According to the description, AIDE will “turn your Android tablet with keyboard into a real development box” and will “turn your Android Phone into a small development computer to browse and touch your code on the go.”

Links

iOS Image Tricks

Adam from Dwellable, the app for finding and reviewing vacation rental homes, shares some iOS image tricks that he used while taking the iPad version of the app and converting it into an iPhone app. These tricks we necessary the app, while it ran acceptably on the iPhone 4, was unacceptable slow on older units like the iPhone 3. The tricks he discusses are:

  • Using an image pipeline to serve the right image for older iPhones, retina iPhones and iPads
  • Using spriting — instead of sending a number of images, send a single large image made up of a bunch of images
  • Using 16-bit images with older devices to conserve memory

Links

Designing for Android: Tips and Techniques

Here’s a guide for designers to help them design for Android, whose ecosystem has many combinations of OS, screen size, aspect ratio and pixel density. In combination with the design guidelines on the Android Design site, this guide will help you make beautiful, usable Android apps.

Links

{ 0 comments }

A Mobile Privacy Policy You Can Use and Customize

Here’s a set of open source mobile privacy policies that you can copy, modify and use for your own mobile apps. Created by Docracy, an online store of open legal documents, you can use them as-is, or use them as a starting point for your app’s privacy policy. Most users consider the mobile device to be more personal than their desktops or laptops (even though they’re called personal computers), and it’s expected that privacy policies will eventually be required for apps; grab these and get a head start! Best of all, Docracy lets you fork their documents GitHub-style.

Links

ManiacDev’s Catalog of Open Source iPhone and iPad Apps

ManiacDev has updated their list of iOS apps for which the source code is available — there are now 85! 67 are currently available in the App Store, and while the remainder aren’t, they were at one time and you can still get the source for all of them. There’s nothing like learning from source code for complete, released applications, and I haven’t seen a bigger collection of such for iOS. If you’re interested in the source for games only, ManiacDev has a “just the games” list.

Links

TheNewBoston.com’s 200-Episode Android Tutorial Video Series

TheNewBoston.com has a video series made up of 200 videos covering Android development. The series starts with downloading and installing the JDK, Eclipse and the Android SDK, covers a lot of ground on writing Android apps, and ends with putting an app on the market and updating it. The presentation style is extremely casual and even made me chuckle a couple of times. I think it’s a pretty good launching point: use these videos as your launching point, back them up with the Android docs, and you’ll be on your way.

Links

Making Money in the App Store in “The Next 19%”

Dave Addey does some back-of-the-envelope calculations and says that while it’s increasingly unlikely for you to get your app in the top 1% of Apple’s App Store, you’ve got decent odds for getting your app into the sweet spot of what he calls “The Next 19%”.  He says that if the numbers he’s using are representative, the iOS App Store breaks down this way:

Tier How many apps? %age of Revenue Average income per app
Top 1% 6,500 36%, or $1.75 billion $269,230
The “Next 19%” 123,500 61%, or $3.05 billion $24,696
Bottom 80% 520,000 3%, or $150 million $288

 

He writes:

With the App Store maturing, hitting that top 1% increasingly requires sizeable investment and marketing in addition to app development skills. Successfully launching a 1% app (even with sizeable investment) isn’t something you’d bet your mortgage on, and I’d go as far as to say that this top end of the store is no longer a market that’s available to small independent developers.

The next 19%, however, is definitely a viable aspiration. Most of the paid apps we’ve released have fitted comfortably within the upper bounds of this part of the graph (beating the 19% average mentioned above), and these kinds of apps are definitely within reach of small development teams or sole developers.

Links

{ 1 comment }

Some Personal Notes

As I wrote earlier, I’ve declared a bit of a summer vacation for myself, but that doesn’t mean it’s been all fun and games and loafing about. I mean there’s been some fun and games and loafing about, but there’s also been a little work as well, what with lining up some conversations about work opportunities, updating the LinkedIn profile and old-school resume and of course, learning iOS development, which is what the Vaya con iOS series of articles is all about.

So, with my trusty MacBook Pro, iPad 2 and iPhone 4S, I got to work…

Just kidding — that’s not me.

As I said, with my trusty Mac and iTools, I got to work…

Okay, enough fooling around.

This is really me. I’m at the girlfriend’s place in Tampa. She goes off to work, while I start the day with an energizing swim at the central pool that almost no one in this townhouse complex seems to use:

Sixty to eighty lengths of the pool later, I emerge, shower, get dressed and then it’s time to get cracking:

She has a desk set up in her living room, which I’ve commandeered for my studies and other work. The laptop, mouse, iPad and phone are mine; Tux, the SUSE gecko, IBM bee and Sun dolphin (alas, it’s not in the shot) are hers.

A few people asked about the Nyan Cat sticker. I bought it at — I almost hate to admit this — Hot Topic (they have good pop culture stickers), cut it into two sections and laid it carefully around the trackpad.

iTunes U’s iPad and iPhone Application Development Course

There’s a pretty interesting iPad and iPhone programming course on iTunes U taught by Stanford’s Paul Hegarty. I enjoy his lectured and have watched the first three without zoning out or dozing off, which I must say is a damned sight better than some moments in my colourful academic career. I suppose not being hung over helps.

Over the course, which was recorded as it took place in the fall term of 2011, students were expected to build two complete iOS applications, with each lecture providing more material. There are 19 lectures in the series, which also includes some supplementary sessions as well as the slides for each lecture. It’s a Stanford computer science course without the Stanford tuition — it’s free! All you need is iTunes. If you decide to subscribe, be sure to get the 2011 course, as it covers iOS 5.

Ray Wenderlich and the iOS Apprentice

While researching blogs and other sites with useful information for developers with programming experience but little or no iOS development practice, I stumbled across Ray Wenderlich’s site. It’s updated regularly with new articles about various aspects of iOS development, and there’s also a regular email newsletter. One of the enticements for subscribing is that subscribers get a free tutorial — the first part of a tutorial series called The iOS Apprentice, written by Matthijs Hollemans.

I used to do Windows Phone tutorials back when I was a developer evangelist at Microsoft, and I was curious to see how someone else did it. So I signed up and soon afterwards, I got an email with the download link for the tutorial, a zip file with the tutorial in HTML form, plus XCode project files for the completed application and all the graphics and other resources needed.

I was impressed, especially because this was free. It’s on par with the NerdDinner tutorial for ASP.NET MVC, which I called the best “chapter one” I’ve ever read.

The tutorial is huge and it’s beautiful; it looks as if it was made by Apple. If you turn it into a PDF, it becomes a 117-page book, and it covers the development of a “Bull’s Eye” game, in which you try to position a slider as close as possible to a specified target value. In the process, you learn a lot: you get an intro to programming in general and XCode in particular, setting up UI controls and responding to events, dealing with different device orientations, adding a modal screen, customizing controls with your own graphics, giving your app an icon, dealing with regular and Retina displays, deploying your app to a device and more.

The tutorial was written for people who’ve never programmed before, but it does move pretty quickly. I wonder if complete novices get stuck in the process. However, I found it easy and skipped the parts in which programming concepts were explained, focusing more on the iOS-specific parts. I didn’t find the fact that it was written for beginners a bother, and I had a lot of fun in the process of following along. I even opened another project to noodle with the concepts I was learning from the tutorial.

In fact, I had so much fun with the Bull’s Eye tutorial that I decided to spend the $54 and purchase the rest. I’m currently on part 1 of the second tutorial, in which you build a reminder list app, which covers TableView-based applications. I found The iOS Apprentice more appealing and more packed with useful information than a number of iOS development books that I’d had the chance to read over and that it’s money well-spent.

If you’ve been putting off learning iOS development for whatever reason, go sign up for the newsletter at Ray Wenderlich’s site, get the first tutorial for free and give it a try. You might be pleasantly surprised.

{ 1 comment }

AppCode’s splash screen.

In my “summer vacation” post, I talked about the tools I’d be using to learn iOS development. One of them is the obvious choice: XCode, the Apple IDE, and the standard tool for developing iPhone and iPad apps. The other is a new tool, RubyMotion, which attempts to simplify iOS development with Ruby as the programming language and Rake as the primary build tool. Each has its pros and cons, and I thought that it would be interesting to learn iOS development through these two different tools and their different approaches.

James Kovacs, Tech Evangelist for the development tool company JetBrains — the people behind IntelliJ IDEA, RubyMine and ReSharper (quite possibly the most-loved Visual Studio add-on) — read my post and kindly offered me a free licence for AppCode, their IDE for MacOS and iOS development with Objective-C. In his email, he wrote:

No strings attached. Develop the next Angry Birds with it and make your millions. Wax poetic about it on your blog. Or bitch and complain about a missing killer feature. Or ignore it entirely and use Xcode exclusively. It’s really up to you.

Thank you, James! Consider AppCode added to my set of tools that I’ll be using while learning iOS development.

AppCode’s “Quick Start” screen. Click to see it at full size.

Having spent three years in the .NET world, I’ve become acquainted with Visual Studio. It’s one of the few Microsoft products that even the most ardent Microsoft-basher will say, often through gritted teeth, beats out all the others in its field. I agree; it’s an excellent IDE, and along with the underappreciated Windows Live Writer blog editing tool, is one of those precious few Microsoft tools that is consistently a pleasure to use.

Nice as Visual Studio is, it’s made even nicer by ReSharper, which adds a whole raft of utility features to Visual Studio. It takes so much drudgery out of coding that I know a number of developers who refuse to use Visual Studio without it (and a handful of purists who disdain those who use it, saying that they’re not really coding anymore). I’ve noodled a little bit with ReSharper, and liked what I saw. At the very least, it gives me some confidence that AppCode, coming from the same vendor, might have something going for it.

AppCode’s “Create Project” window.

XCode doesn’t get the same love that Visual Studio does. You’ll find many MacOS and iOS developers who like it enough and who’ll point out that it’s improved greatly over the past little while, but even the die-hard fans will say that it’s pretty clunky in places. That’s part of the appeal of alternative tools like RubyMotion, and I was curious to see how AppCode stacks up.

AppCode’s editor window. Click to see it at full size.

A little searching took me to The Code Sheriff, Yoni Tsafir’s blog, and an article in which he compared XCode to AppCode in a number of categories. AppCode wins in a number of categories, especially in those where you are doing a lot of straight-up coding: making quick fixes, refactoring, code completion and generation, keyboard shortcuts and code inspection. In other words, the sort of stuff with which ReSharper juices up Visual Studio.

AppCode doesn’t have an interface-building tool like Interface Builder, which is no longer its own app; it’s now part of XCode. I’m going to experiment with building apps with XCode alone along with taking a hybrid approach and bouncing between XCode and AppCode. That’s not all that different from bouncing between Visual Studio for coding and Expression Blend for UI, something which I did regularly when I was the Windows Phone evangelist.

So now it’s XCode, AppCode and RubyMotion. Thanks, James and JetBrains!

{ 1 comment }

Cover of "iPhone and iPad App 24-Hour Trainer"

Okay, I’ve got the “vacation” part of my summer vacation down, and now it’s time to get down to work. By that, I mean one of things I’d been planning to do on this sabbatical — aside from flying to Tampa, then Manila, then back to Tampa — was to finally learn iOS programming. It occurred to me that I was long overdue when I got my annual renewal notice for the iOS Developer Program and realized that I hadn’t done a damned thing with it. I’ve now got the time and the motivation, so the journey begins!

I’ve decided to start with the exercises from Wrox’s iPhone and iPad App 24-Hour Hour Trainer because of the way the authors Abhishek Mishra and Gene Backlin structured the book: “Here’s a feature of iOS, here’s how it works, now here’s an app you can build and noodle with to take that feature for a spin”. Each exercise is short enough to be done in an afternoon (and many of the earlier ones are even shorter), so there’s plenty of that quick gratification that one needs when embarking on a new platform.

I’ll post regular entries about my progress and impressions of the book as I work through the exercises here on Global Nerdy. As I’m fond of saying on my blogs, “Watch this space!”

{ 1 comment }