ixx
ixx

Reputation: 32269

Android benefits and drawbacks of build target upgrade?

I changed the build target from 7 to 16, with the only reason that I want to compile with the newest SDK. I still want to target versions starting at 7.

My project compiles and ran without problems on 2 devices. But I'm not sure if this is safe. I don't want to realease and that it crashes on some devices, because some things I'm not aware of.

Does it anyways make sense to upgrade the build target, without any specific reason?

Edit: Just to make it clear - I'm not doing it to target newer versions or support new features (I'm already using the compatibility library). It's just, because, maybe with newer build targets the internals have been improved - like performance, etc.?

Upvotes: 1

Views: 244

Answers (1)

Veger
Veger

Reputation: 37915

If you do not use any functionality of the new SDK version(s) it does not make sense to update this requirement 'just for upgrading it'. When running your application on a device, it will use that version, so it already makes use of the newest internals.

The android library is backwards compatible (meaning it is compatible with older version). The support library provides forward compatibility (meaning it adds functionality to match the newest android library version), the support library is provided with the application (in the APK), so it is available when required. The application first tries to use the android library (so it always uses the newest internals for that device) and if functionality is not present, it tries the support library.


If you require some new functionality then you should upgrade to that SDK version. And (eventually) add code to check the running version and provide an alternative for devices with a lower SDK version.

To find out the SDK version at run-time, for providing alternatives, use android.os.Build.VERSION.

Upvotes: 2

Related Questions