how do you write an iPhone app?

or any device app, for that matter?

Is there a software language specifically designed for these apps, or can a developer use whatever they want?

for example, are they required to be written in C, C++, perl, or another script language?

If I have an idea, and write the app, where do I compile/test it? Does the iPhone, droid, or whatever have a testbed to download and compile your code, or do you have to do that on your own?

Thanks

iPhone apps are written in Objective-C. You need the iPhone SDK. Start here: iOS 17 - Apple Developer

Android uses Java along with their SDK. You can test the app on your PC using an Android emulator. You can develop for Android on Windows , Linux or a Mac but only a Mac can be used for iPhone work.

You may want to read the external source of the agreement before you enter Jobs’ lair.

Here’s the nutshell overview from someone who’s done at least a little development for most of the major phone platforms:

Many, many phones have what’s called a J2ME environment. Cheap phones, fancy phones, smartphones, J2ME is nearly everywhere and was touted as the way to write portable phone apps for years. You write your app in java and J2ME is effectively your API and dictates the feature set of the java runtime you’re running in. In theory, this is a standard that you can write your app to and run it anywhere that supports J2ME. In practice, there are enough differences in J2ME platforms that that’s not really true.

Windows Mobile smartphones are programmed by either writing Win32 applications (using e.g. C++ or C) or by writing .NET applications (using e.g. C#) and compiling them using the microsoft smartphone SDK’s. Windows Mobile phones can also run J2ME applications, but they’re sort of second-class citizens (you run a shell application which lets you select a J2ME application to run, and it feels sort of rudimentary and not well-integrated into the rest of the WM environment, as if you were running an emulator or something)

Blackberry applications are written in java using the Blackberry SDK, which is sort of parallel to the J2ME model, with Blackberry-specific extras. You can write a J2ME app and it is pretty much a first-class citizen on Blackberry, but you lose access to the extras you’d get if you used the “native” Blackberry APIs instead (examples: trackball API, background apps).

Symbian phones are programmed using C++ and the Symbian SDK. Many Symbian phones also run J2ME apps.

iPhone applications are written by writing in Objective-C and using the iPhone SDK, as mentioned above. No J2ME.

Android applications are written in java using the Android SDK. I don’t know if Android can run J2ME apps or not, but I think not.
So generally, the bottom line is that for the modern big phone platforms, you need their SDK and that basically dictates the programming language. J2ME was designed and touted as the way to write portable phone apps, but it’s really dying out and is really only useful if you want to target low-end phones nowadays. Windows Mobile offers a choice of languages because they have .NET, but honestly, nobody cares about Windows Mobile (and all the .NET languages aren’t really supported by their mobile tools anyway. You get C# or C++, basically.).

Just thought I’d mention: Stanford University has an iPhone programming course that they filmed and published online for free (winter 2010).

What more could you ask for?

I’m on lecture five or so, kind of bogged down with other distractions, but really learning a lot about the iPhone.
They not only make the class notes and assignments available online, but you download all lectures in iTunes.

If you already know c# and prefer that to Objective C, you can use Mono and MontoTouch(from Novell) to write iPhone apps. I have not had a need to do so, so I cannot comment on the toolset at this time.

Not sure where MonoTouch fits in the landscape, but Apple has taken a strong stance against non-Objective C coding:

iPhone 4.0 SDK bars un-Jobsian code translation

Folks,

Thank you so much for the great information! I hope others have learned from this thread, because there is a ton of great info to get one started.

Another quick question for those that have gone through this process.

Say I write the greatest app (at least according to me), is there a number of hoops I have to jump through to get it “published”, (ie, I could get it on a number of websites for downloading), or can I just put it on my iphone, pass it around to my friends, put a link of it on my website and allow anyone to download it for free?

I assume there is a QA process for anything that ends up being “blessed” by apple to be on its phone, so if I want it to be apple approved, would it cost me any money to get it through the process, or does apple provide this service for free to developers?

This is one instance where getting a book would probably be helpful. I browsed one in a bookstore and learned a lot in 10 minutes.

The SDK is free, but it’s $99 to be able to publish and “sign” apps. Only signed apps can run on the iPhone/Touch/Pad.

Let’s say you’ve written the application. You have 3 choices for distribution.

  1. For your hundred bucks, you get to install it on 100 devices. That said, the provision profile (the magic file from apple that allows you to install the software on a device) expires every 3 months. You have to pay the $100 every year.

This is called “ad hoc distribution”.

  1. For (if memory serves) $400, you can get an enterprise license. I didn’t do that, so I don’t know the details

  2. The app store.

Create your app, don’t break any rules (written or unwritten), submit to Apple, they run (apparently) automated tests to make sure it doesn’t e.g. use private APIs, and they put it in the store for you.

Apple keeps 30% of the revenue and direct-deposits the rest in the account you supply at time of submission. The process takes roughly 2 weeks, most of the time.
The testing by Apple is not QA testing. Your app can suck and crash all the time. They are checking to see if you violate an ever changing set of content-based violations, and if you foolishly use, for instance, the really cool easy to use CoverFlow api instead of rolling your own (he wrote without the faintest trace of bitterness). There have been some complaints that the process is a little opaque, but it is in no way a QA process.

I don’t understand the part about rejected apps - I thought some apps were available on multiple platforms. Does Apple not let you also make an app for the Droid if you already have one for the iPhone?

No they don’t stop you doing that, yet :slight_smile: Thing is, because of the above mentioned distribution restrictions on iPhone apps - which are enforced on the phone’s OS, so you can’t just ignore them - you either play by the app store’s inscrutable rules, or you basically cannot make your app available to the general public - at least that part of the GP using iPhones.

You can still do whatever you want (well, play by some other rules if you want to sell on the “official market”) on the other platforms, and for Android and Win phones at least (dunno about RIM or WebOS), you’re pretty much free to distribute your work to whoever you like, however you like it. But however you cut it, Apple’s current stance on which techniques are allowed to be used for iPhone apps, you can completely forget about using one streamlined system to build multi-platform apps; you’ll have to write the iPhone app using Apple’s tools.

OK I went to the link where it explains that if you are rejected, you can’t sell it as an underground Iphone app, rather than not selling as an alternative platform app.