This doesn't make me an expert on the subject, but I think if like me - you're thinking about starting with iOS development or mobile development in general, this post might save you some time and make sure you're not missing any of the important technologies available today (August 2011), and the information you need to know in order to get started.
Before You Start...
Do I have to own a Mac in order to develop for iOS?
- In a word: YES.
- There might be frameworks that will let you develop the applications without a Mac, but when you'll want to deploy on a real device, or to the app-store, you're going to need a Mac for that.
- Even if you succeeded in creating a Hackintosh on a VM (I personally had a really hard time trying to do so...), it is not recommended - as you are going to have troubles once you'll need to update your software/OS version, etc.
- I tried to find online solutions for "Mac for rent", and found macincloud.com, but 2 days after sending a request for a trial they announced they closed the site for new users.
Does it cost me money to develop iOS applications?
- The iOS Developer Program costs 99$/year. It lets you have the development environment for free, and the ability to install your apps on up to 100 personal device, and deploying them to the App Store.
- You can however, obtain xCode (the development environment) for 5$ in the Mac App Store, or get the 4.1 version comes free if you have OS X Lion. This will let you develop apps freely, and test them on the iPhone/iPad simulators. If you'd like to test them on a real device as well without paying the 99$, you'll have to jailbreak it first (which is a big No No if you're planning on deploying it to the App Store in the future).
What kind of options do I have?
- Well, it seems as if the most popular choice is simply to re-write your app for the other platforms using the platform's native framework + SDK. This might sound surprising, but understandable once you think about the downsides of the cross-platform solutions available today.
- Notice that because both Java (Android) and Objective-C (iOS) can integrate with C/C++ code, writing at least some layers of your application in C/C++ will make it easier to port it to other platforms.
- Even though there are some downsides, there is a variety of available frameworks for developing cross-platform apps, and I'm going to discuss all the notable ones later on this post.
- Native Features: Most of the available cross-platform solutions won't let you access all the native features of the hardware. For instance, if you want to record real-time data from your microphone or camera, you'll have to write native code that does it, even if your basic framework is cross-platform.
- Performance: Like cross-platform solutions on the PC, a cross-platform solution in mobile devices comes with a performance overhead, some more than others.
- User Experience: Your UI will fail to address the special look-and-feel and the specific features of a given platform, like the 4 physical buttons that exist in Android vs. the single home button in iPhone, which will surely feel awkward to the user.
- While following smule, a great music-related iOS app developers, I found an interesting post they shared about why they don't develop applications to Android:
- Another thing they claimed, is that it's impossible to do real-time audio processing in Android due to high latency: "right now if you create an app for android that just routes the audio from the microphone to the speaker, there will be a noticeable delay, even on the devices with fast processors. This is a problem because if you want to make an app like 'I Am T-Pain' then it becomes impossible from a user experience standpoint to do live vocal processing. Put another way, hearing your voice come out of the speaker delayed creates a user experience that is not on par with that which we've been able to create on iOS. - this is a major problem if -- like I do -- you want to include real-time audio processing in your applications.
- On the other hand, it seems that the majority of the mobile devices in the market is soon going to be Android's: http://www.mofonu.com/2011/07/15/android-devices-130-million-and-growing-%E2%80%93-550000-devices-activated-everyday/
Some useful links to get you started
- I highly recommend Stanford's iOS development videos in iTunes U: http://itunes.apple.com/us/podcast/cs193p-student-final-projects/id395605774?i=90218598
Which covers both Objective-C basics and the iPhone's SDK. It's from Fall 2010 and there might be newer ones in iTunes U, but I personally watched the first few videos and I am really pleased with them.
- A great blog with a variety of tutorials on iOS and game development: http://www.raywenderlich.com
- Another great source for Objective-C and iOS related tips and issues: http://iphonedevelopertips.com/archives
- If you speak Hebrew, a great intro by Hezi Cohen, focusing on objective C and xCode: http://www.youtube.com/watch?v=GVAWfqTyhcA
- iOS Dev Center: http://developer.apple.com/devcenter/ios/index.action
You should read the iOS development guide, and all the different guidelines there. It may look long and boring, but it pays off!
- An additional layer to C that introduces objects
- Syntax is ugly (smalltalk like), but not something you can't get used to
- Memory management is better than C, but you still need to be very aware, unlike modern languages. However, iOS 5 will support Automatic Reference Counting (ARC), so this should alleviate the pain. (See http://developer.apple.com/technologies/ios5/)
- Has some very features of modern languages, like automatic getters&setters, nil objects that do not causes a crash if referenced, and dynamic language features - altering existing classes, invoking methods dynamically, etc.
- The iPhone SDK and all APIs are written in Objective-C (Including the UI layers), and as said before - you are probably going to write at least one layer of your application in it, so you definitely should learn Objective-C if you are planning on developing for iOS.
- A GREAT summary about Objective-C's basics: http://www.otierney.net/objective-c.html
- Basically, it's like VisualStudio for iPhone applications. Seems like a decent tool - autocompletion works very nicely, and there are built-in UnitTests support which is great (no green bar though...)
- Comes with a set of tools, like the iPhone simulator which is a very good way to feel how your app is going to appear on the device without actually deploying it, and other important tools like a profiler, a memory debugger, etc.
- Will take some time to adjust to, and from first look - it's powerful, but lacks some advanced refactoring features IDEs like Eclipse have.
- I heard some that claimed that even if you develop in other IDEs, you'll still have to compile them eventually in xCode before submitting to Apple. However, I guess this was true prior to a change in Apple's policy regarding development tools, in September 2010.
- One prominent alternative for xCode is Appcode by JetBrains (IntelliJ dudes): http://www.jetbrains.com/objc/ - haven't thoroughly checked it out yet, so no review.
- Official website: http://www.khronos.org/opengles/
- OpenGL ES is a subset of the OpenGL 3D graphics API, designed for embedded devices, including mobile phones. A subset - meaning some of the features of OpenGL such as floating point operations might not be available, and you'll have to replace them with alternatives if you're planning on porting an existing desktop OpenGL application.
- The upside of developing in OpenGL ES, besides being a strong and popular 3D graphics engine, is that it supports many platforms. Implementations always have a platform-specific part, and the OpenGL API which is the same on all platforms for a specific OpenGL API version (which unfortunately may differ between the Android SDK and the iOS SDK). So while your code won't be 100% cross-platform, it should be easily portable, especially if you create proper abstractions between the platform-specific and non platform-specific part.
- A great set of OpenGL ES tutorials for iPhone can be found at http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-table-of.html
- Link: http://www.cocos2d-iphone.org/
- An open source objective-C based framework for easily developing 2D games for iOS and Mac. Based on OpenGL ES.
- Contains nice features such as scene managements, menus and buttons, tile map support, high score server, and many more.
- Very popular - has a large community and lots of cool games created with the framework.
- The tutorial in the official site seems very effective, and there are lots of other books and tutorials out there.
Web Based Cross-Platform Solutions
- This is a good solution for developers who already experienced in web, and do not wish to learn objective-c or other similar technologies.
- On the other hand, although some of these frameworks allow you access to the hardware of the devices, it is limited in comparison to real native apps. Also, there are major performance limitations, and of course there's the native look-and-feel issue I mentioned earlier.
- The most popular examples of such frameworks are: PhoneGap and Appcelerator Titanium. I must admit my research less focused on them so I can't really say how they are, but I do know they are popular and has a large community, and on the other hand - they have the known limitations mentioned earlier.
- To sum it up, here's a nice presentation by Onavo about the dilema of Native apps vs. Web Apps: http://www.slideshare.net/onavo/advanced-ios-engineering-the-junction-talk
- Link: http://rhomobile.com/
- A bit similar to the rest of the web-based cross platforms solution, except that it's Ruby based, and should be more powerful regarding hardware capabilities.
- Personally I'm more of a python guy, but from the little I know, ruby is a really fun dynamic language.
- According to their claim, apps written with rhodes are faster than Android apps written in Java, because it's written
- Hardware capabilities currently include access to GPS, camera (only still pictures), bluetooth, audio playback, barcode recognition, and more. Audio/Video capture is planned in future releases.
- Integrates nicely to all popular IDEs, with a built in unit-testing framework, etc.
- All in all, seems like a good option if your app doesn't require intensive graphics or performance, and you like ruby, or at least prefer it over objective-C.
- Link: http://www.madewithmarmalade.com/
- Until recently known as 'Airplay SDK'
- A cross-platform infrastructure in C++ - mainly targeting game development but according to them "Marmalade’s sweet spot is 'rich' apps, by which we mean any combination of: great graphics; audio processing; use of device APIs such as camera, GPS, and microphone; deep C/C++ codebase; or anything else that raises your app above the level of a simple mobile website wrapper"
- They have a plugin for the existing IDEs: either Visual Studio in Windows, or xCode in Mac - which makes it very comfortable to develop.
- The support for platform-specific code (called EDK) gives an automatic layer of abstraction that makes it very easy to write a cross-platform app that takes advantage of native features.
- There is a very impressive portfolio of games developed with this SDK, like games by Electronic Arts, or PES by Konami.
- All in all, this looks like one of the top choices for developing cross-platform applications.
- Seems like a very powerful cross-platform game engine. Has good documentation and a good community of Q&A. http://unity3d.com/
- In general, seems like this is a very strong option for game development, especially if you are developing 3D games for multiple platforms. However, accessing the microphone/camera of the mobile device + other advanced features will require using native plugins.
- It seems that Flash is a decent cross platform solution for developing native iOS applications. Surprised? So was I. Here is a summary about that: http://www.adobe.com/devnet/logged_in/abansod_iphone.html
- Here are some nice tutorials:http://www.paultrani.com/blog/index.php/2010/11/tutorial-creating-mobile-apps-using-flash-cs5/http://active.tutsplus.com/tutorials/mobile/flash-for-iphone/
- In general - seems like a great solution if you are an experienced Flash developer, or you already have a Flash version of your application that you want to deploy it to the iPhone. The open question is: is the performance going to be good enough?
- Link: http://www.anscamobile.com/corona
- Based on the Lua scripting language, should be similar to ActionScript. There's a nice blogpost regarding how to port a Flash application to Corona: http://blog.anscamobile.com/2011/01/flash-to-corona-porting-guide/
- Claims to focus on performance and from the showcase seems like there are very impressive games developed with Corona.
- Has access to many of the device capabilities, including camera, microphone, GPS, etc.
- There's a free unlimited trial, but you need to buy a subscription in order to distribute apps.
That's about all I have researched and can share with you currently. I hope that with time, after gaining some hands-on experience, I'll have some more useful knowledge to share in this blog. So if you're interested - stay tuned: subscribe to the blog, or follow me on twitter.
I would like to welcome any comments you have about the information written here: if you feel I left some important information out, if you spotted a mistake or two in the data, or if you have a personal opinion about some of the frameworks I mentioned. Please leave your comments as a reply to this post. I promise to take them into account.
Edit: Thanks @philxan for mentioning I forgot about MonoTouch
- Official Site: http://ios.xamarin.com/
- Part of the Mono Project (http://www.mono-project.com/Main_Page) - a solution that allows you to write cross-platform C# application.
- Basically, it's a C# framework that integrates with the desktop Mono SDK and the iPhone SDK and lets you create native applications in C# and the .NET framework. Should be interesting mostly if you're looking to port an existing C# application for iOS, or if you're an experienced C# developer and want to save yourself the efforts of learning and adapting to new technologies.
- The IDE is MonoDevelop for OS X - looks a solid IDE, but I can't say I tried it personally.
- Cost begins at 399$ for a personal license...
- Has a version for Android (and naturally Windows Phone) as well
- Here's a good site with code samples: http://monotouchexamples.com