Does supporting multitasking in iOS 4 mean dropping support for iOS 3? - iphone

I can't find anywhere definitively, if you build an app against the iOS 4 SDK, to thus support multitasking, does that mean the app won't work in iOS 3? If not, how can you support iOS features like multitasking but still support iOS 3? I'm sorry if there are Apple docs on this, I'm happy to read them, I just can't find them. Thank you

You can build against a 4.x Base SDK, and set the Deployment Target to 3.x.
But you have to make sure not use any of the new 4.x APIs without checking for their availability first (or you will start to run, then crash as soon as you call one of those APIs on a device running 3.x). And you will need to test thoroughly on an actual device running iPhone OS 3.x since there is no simulator support for this kind of OS portability testing.
In some cases, converting a 3.x app to also allow what is called "multitasking" under 4.x is as easy as rebuilding the app using a new 4.x Base SDK, but leaving the deployment target where it was at 3.x, and adding an applicationWillResignActive: delegate to handle both suspend and potential termination.

No it does not. iOS 3 just ignores the delegate methods that get called.
However, if you try and launch a background task, you'll have to check for the API first, otherwise yeah, you'll not run on 3.

Related

iOS app maximum iOS version support

I have developed my app in Xcode 4.1 and iOS SDK version(Base SDK Version) is iOS 4.3 So, will this app run on iPhone with iOS 5 and/or iOS 6 or not?
I think the app can be run on a higher version of the OS than the Deployment Target. Is this right? I appreciate any help.
Yes, your app will run on anything that is iOS 4.3 or newer. That is, assuming you aren't using any depreciated methods that are removed from a future iOS release. You can check if things have been depreciated/removed through the documentation.
It doesn't matter with which Xcode you build your app, the base SDK signifies the lowest system your app is supporting.
You app can and will run on newer systems.
If you want to make an update to your app, you'll need to pay attention to depreciated methods for the newer systems or you will get rejected and won't be able to update in the App Store.
Yes, it will for sure run in higher versions than Deployment Target.
However, is always recommended to run also in newer versions as they are released, to check that every API used is still running fine (specially if they were deprecated).

iOS is forward compatible or backwad compatible

I would like to know whether iOS apps are forward or backward compatible.
If I design an app in iOS4 can it be run on iOS5.
Android is forward compatible, can be built on SDK 1.6 and the same app can be run on newer versions of Android Operating Systems.
How about the iOS?
I would say it is. But you should always check your apps when a new version of the framework is released.
I remember that some of my old apps crashed when I updated to iOS 5.
The question have been answered before here.
Yes it would work. Although you should check if certain methods have been deprecated, or changed in some way, so for instance you might be able to use a method on iOS4 and that method been changed in some way in iOS5. The same is true for backward compatibility, certain classes only appeared on iOS5, and you will have crashes when using those on iOS4. Bottom line: test on both version your application.
There a couple of question/answers regarding this topic:
Pitfalls when writing an iOS app supporting iOS 3.1.3 and iOS 4.x
Recommended way to support backward/forward compatibility in iPhone app?
Generally speaking, this is true. There are some exceptions though, and the only way to be sure is to test the app on different versions.
A big difference with Android though is that most handsets are up-to-date with the latest OS, so if you are starting a new project you should probably consider targeting iOS5.

Check SDK methods used in an iPhone app

As Apple adds new APIs and new methods to APIs with every new iOS update or release and given that nowadays you can't even test on an iOS 3.x simulator, is there any way to test your iPhone app in older SDKs or to know what SDK level you are using through it?
Downgrading to an old Xcode with a 3.x simulator is not an option and, well, there are tons of methods introduced in, say, 4.2.
Has any one come up with a lib, script, tool, anything, that analyzes the code to show API usage?
The way most iOS developers do this is to keep around an old 1st or 2nd generation iPod Touch (or other old iPhone device) that hasn't been updated past the oldest iPhone OS version that they plan on supporting with their Deployment Target setting.
A cheap used iOS device, even with a scratched/cracked display or mostly dead battery, from eBay (et.al. or some neighbor or nephew who upgraded), might work.
Testing on an old device is actually a better and more accurate check than just testing with the Simulator, as the Simulator for various SDK versions supported APIs that the device at that OS level did not.

iPhone application compatibility

Please how can I make sure before developing my iPhone app that it will be compatible with iPhone4, 3GS, iPod touch and 3G?
You need to create the app keeping in mind all the features available in lowest version of iPhone you need it to be compatible to.
For Example:
Suppose you want it to be compatible to iPhone 2G then you cannot use in-app SMS feature as iPhone 2G cannot be upgraded to iOS 4.0 or higher.
In-app SMS feature is only available in iOS 4.0 and higher versions.
Hope this example gave you a proper idea.
Once the app is made, you should test your app throughly on different devices i.e. iPhone 3G, iPhone 3GS and iPhone 4 and iPod Touch.
Unless you test it on device, you cannot be sure because sometimes some of the things work in simulator but crashes on device.
So better to test on device.
Hope this helps you.
If it's the SDK you are talking about, you might want to make sure it runs on iOS 3.X versions. See here for more details.
If it's the hardware you are talking about, you will need to test your app on separate pieces of hardware to make sure that they all run.
The settings in XCode that you make regarding which version of iOS your app will be compatible with is the iOS deployment target and the Base SDK. The Base SDK is the default version you are building against (this should be set to the most recent SDK which is currently 4.3). The iOS deployment target is the earliest version you would like your app to be available for (currently goes back to 3.0 on XCode 4).
These settings are in the settings for your target.
As for if your app will actually work on all of these devices depends on how you program for them. In other words, if you are using new APIs, they obviously will not work on versions that did not implement them.
Hope this helps.
Jamie
You can't be sure without testing. (and even with testing, some say...)
There are potential "gothcha's" in the iOS API documentation, in the Simulator handling of those APIs, and particularly in device performance, which you may not realize or be able to guess until you actually try an app out on all the device models and iOS versions which you plan to support.
Even some simple apps with no undocumented API use and no compiler or analyzer warnings, et.al., have been know to "break" after a new OS version is released.
You can "claim" an app is compatible by appropriate setting of the Deployment Target in the Build settings, lack of plist hardware restrictions, and in the app store submission data. But that's only a claim, not compatibility.

Build an iOS4 app that will also deploy on iPhone OS 3.x devices

I've got a couple of applications in the App Store at the moment which I've had ready after the release of iOS4. If I try and download one of these in the App store on a 3.x device, it will tell me I need to upgrade. Is there a way to make my application not do this, as I don't think I am using any API calls specific to iOS4.
I originally thought that this could not be done but I just now installed 'Plants vs Zombies' and 'Angry Birds' on my iPod Touch (running 3.1.3) so it must be possible as I'm sure these have released updates recently, and being in the top5 games, I would have thought they were developed using the iOS4 SDK. I am hoping it is just one value somewhere but if anyone could let me know how to do it that would be awesome :).
Easy. Open up your project info.
Find this line "iPhone OS Deployment Target" select 3.0
You can still develop with the latest xcode and current 4.0 SDK, but if you dont make any 4.0 calls this should allow you to weak link to 3.0+ and allow apps to work.
You really should test this on a 3.0+ device to see if it works though. You can still set your Base SDK to 3.2 or 4.0.