Writing iPad apps: what you need to know
Posted on 15 Dec 2010 at 15:54
Paul Ockenden offers practical advice on building apps for Apple's tablet
Recently I looked at the iPad from a business angle, and now I want to examine designing applications for it.
There are three possible approaches: first, to write native apps, to do which you have to sign up to Apple’s iOS developer program. This costs £60 a year and, as well as the developer tools, provides access to beta releases of new iOS versions long before they go public.
If buying new hardware and learning a programming language and framework sounds too painful, the second option is to use an app platform that targets the iPad
One possible downside is that you’ll need a Mac, as Apple’s tools are, not surprisingly, Mac only (you’re about as likely to see Apple release a Windows version of Xcode as you are to see Microsoft porting Visual Studio to the Mac). You could employ some kind of Hackintosh (a way of getting non-Apple PCs to run OS X) or run OS X inside a VM, both of which are possible but breach the OS X licence conditions. Frankly, for most people they’ll be too much hassle. You’d be better off picking up an Intel-based Mac mini on eBay for a couple of hundred quid, as that will be more than adequate for writing iPad or iPhone apps.
A bigger problem may be that you need to learn Objective-C. Many C++ users expect that Objective-C will be similar, but it isn’t – it’s more like old-fashioned Kernighan and Ritchie C mashed up with some Smalltalk. I’ve heard it described as the worst bits of C with the clumsiest bits of Smalltalk laid on top, but that’s a bit harsh.
You can write C++ methods, but the Apple frameworks are all written in Objective-C, so you have to master that before you can start work with the iPad’s GUI and other bits. I’ve written a lot of C++ in the past and I find Objective-C’s lack of constructors and destructors a real pain, forcing you to initialise and free everything manually. It uses only a single namespace too, so forget public and private objects. It’s really like going back to old-school programming.
In addition to learning Objective-C you’ll also need to learn Cocoa, the framework at the heart of all iOS apps, which is philosophically very different from Windows programming (which is only natural given how different the iPad and Windows user experiences are).
If buying new hardware and learning a programming language and framework sounds too painful, the second option is to use an app platform that targets the iPad. The best known is Flash, but other specialist engines are available, such as Unity 3D and Stonetrip ShiVa3D, both of which are primarily for creating games but can also be used for other kinds of app. Both of them, like Flash CS5, enable you to develop an app on a Windows PC and then target-compile it for the iPad.
Perhaps I’m overcautious, but I’d be worried about going down this route for any high-profile project, or for one with significant manpower or financial investment because of the capricious nature of Apple’s app approval process. At first it was happy to permit apps built using third-party tools, then it banned them (causing a big spat with Adobe), then it decided to allow Flash and similar apps again, mainly to appease EU regulators.
Who’s to say this notoriously fickle company won’t change its mind again in a few months’ time? Nothing in life is certain, but given Apple’s SDK and app deployment rules I’m not prepared to bet the farm on a Flash- or Unity-based project.
You can make a browser-based app run like any other iPad app, taking over the full screen (without the address bar and so on) and employing Webkit CSS to give your app the iPad/iPhone look and feel. It can respond to gestures such as touch, scrolling and scaling, and can even put its icon on the Springboard. Best of all, you can cache your browser-based app so it will run even when the device has no internet access.
There are a few iPad quirks you’ll need to be aware of whether you’re writing HTML-based apps or just want people with iPads to access your existing website or web application. The first is that you can’t use Flash. Perhaps Apple and Adobe will kiss and make up some time, but until that happens Flash is a no-no (but I’m sure you already knew that).
Another gotcha is scrolling blocks within divs and iframes – the usual one-finger swipe gesture triggers the window.scroll() event in Safari, which makes the whole page scroll rather than just your block of text. There’s a two-finger scroll gesture available on iOS devices that does what you need, but in my experience most iPad users don’t know it exists, so I’d advise you not to scroll text blocks – at least not for important content.
- How to add in-app purchasing to an iPhone, Android or Windows app
- Remote-control ransomware: TeamViewer and software hardball
- Why laptops with serial ports matter to the Internet of Things
- Make your mobile battery last longer
- Small steps into handling Big Data
- Nexus 5: does it really run stock Android?
- How to get broadband to a garden office
- How to write your company's IT security policy
- Raspberry Pi and Wolfram: a must-have for every child
- Could you get by with Office Web Apps?
- How Google Glass ruined my lunch hour
- Smartphone battery packs: can a USB power pack beat the festival battery blues?
- Windows Easy Transfer – not so "easy" in Windows 8.1
- Formula 1: what a difference virtualisation makes
- Office of the future: comfy chairs and tablets everywhere
- I went to Glastonbury and the only thing that got high was my smartphone
- Meet the robots helping teach children
- PaperLater: would you pay to print the internet?
- Amazon vs Kobo: how much to make the ebook switch?
- Phishing emails: how I nearly got caught out
- Will the next Windows 8.1 update arrive next month?
- BT One Phone lets SMBs ditch landlines for mobiles
- Microsoft shows Modern apps running in desktop windows
- Apple and IBM buddy up for enterprise push
- Windows Phone 8.1 starts rolling out to Nokia phones
- Government broadband plans "lack ambition"
- SMBs get Office 365 price cuts, new plans
- Windows 7: you can keep it until 2020
- BlackBerry Passport's square for spreadsheets
- Microsoft to release six updates this Patch Tuesday