Maintaining Forward Compatibility

New Android versions are generally additive and forward compatible at the API level. In fact, a device can be called an Android device only if it passes compatibly tests with the Android APIs. However, if an application makes changes to the underlying system, compatibility is not guaranteed.To ensure forward compatibility of an application when future Android updates are installed on devices, follow these rules suggested by Google:

■ Do not use internal or unsupported APIs.

■ Do not directly manipulate settings without asking the user. A future release might constrain settings for security reasons. For instance, it used to be possible for an app to turn on GPS or data roaming by itself, but this is no longer allowed.

■ Do not go overboard with layouts.This is rare, but complicated layouts (more than 10 deep or 30 total) can cause crashes.

■ Do not make bad hardware assumptions. Not all Android devices have all possible supported hardware. Be sure to check for the hardware needed, and if it does not exist, handle the exception.

■ Ensure device orientations do not disrupt the application or result in unpredictable behavior. Screen orientation can be locked, as described in Chapter 2.

Note that backward compatibility is not guaranteed with Android. It is best to declare the minimum SDK version as described in Chapter 2, so the device can load the proper compatibility settings. Utilizing other new features on older targets is also discussed at various places throughout the book.

Character Building Thought Power

Character Building Thought Power

Character-Building Thought Power by Ralph Waldo Trine. Ralph draws a distinct line between bad and good habits. In this book, every effort is made by the writer to explain what comprises good habits and why every one needs it early in life. It draws the conclusion that habits nurtured in early life concretize into impulses in future for the good or bad of the subject.

Get My Free Ebook

Post a comment