I want to write an app using Android SDK and Eclipse. I installed Android 4 Platform using the SDK Manager, but I'm wondering, will this app work with Android 2 Devices? or only Android 4 Devices?
Thanks.
I want to write an app using Android SDK and Eclipse. I installed Android 4 Platform using the SDK Manager, but I'm wondering, will this app work with Android 2 Devices? or only Android 4 Devices?
Thanks.
It depends on the system calls you make. Always test on devices running different versions, because certain calls only work for certain API levels.
On the sdk website you can see this info.
(See the "Since: API Level 9" on the right part of the grey bar of the getNumberOfCameras fn)
In your App Manifest XML file you must specify the Minimum and Desired Target SDK version. I am developing a App that Target Android 4.0.3 (SDK v15) but must run on 2.3.3 (SDK v10).
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="15" />
Off course you have to use only the lower SDK available functions. You should also look the Google Support Library thats make available some new functions for older SDK. http://developer.android.com/tools/extras/support-library.html
// Marcello
Android Lint is a new tool introduced in ADT r16, which automatically scan and check your project for new API, and show you a nice error mark inside your Eclipse editor.
Rule for checking new API, see here:
NewApi
------
Summary: Finds API accesses to APIs that are not supported in all targeted API
versions
Priority: 6 / 10
Severity: Error
Category: Correctness
This check scans through all the Android API calls in the application and
warns about any calls that are not available on *all* versions targeted by
this application (according to its minimum SDK attribute in the manifest).
If your code is *deliberately* accessing newer APIs, and you have ensured
(e.g. with conditional execution) that this code will only ever be called on a
supported platform, then you can annotate your class or method with the
@TargetApi annotation specifying the local minimum SDK to apply, such
as@TargetApi(11), such that this check considers 11 rather than your manifest
file's minimum SDK as the required API level.
In Eclipse: