Monthly archives: September, 2016

Using the Version-Aware Component in Android

Now that you have two implementations of TabHelper and CompatTab—one for Android 3.0 and later and one for earlier versions of the platform—it’s time to do something with these implementations. This lesson discusses creating the logic for switching between these implementations, creating version-aware layouts, and finally using the backward-compatible UI component. Add the Switching Logic …

Creating an Implementation with Older APIs in Android

This lesson discusses how to create an implementation that mirrors newer APIs yet supports older devices. Decide on a Substitute Solution The most challenging task in using newer UI features in a backward-compatible way is deciding on and implementing an older (fallback) solution for older platform versions. In many cases, it’s possible to fulfill the …

Proxying to the New APIs in Android

This lesson shows you how to subclass the CompatTab and TabHelper abstract classes and use new APIs. Your application can use this implementation on devices running a platform version that supports them. Implement Tabs Using New APIs The concrete classes for CompatTab and TabHelper that use newer APIs are a proxy implementation. Since the abstract …

Abstracting the New APIs in Android

Suppose you want to use action bar tabs as the primary form of top-level navigation in your application. Unfortunately, the ActionBar APIs are only available in Android 3.0 or later (API level 11+). Thus, if you want to distribute your application to devices running earlier versions of the platform, you need to provide an implementation …

Dimming the System Bars in Android

The system bars are screen areas dedicated to the display of notifications, communication of device status, and device navigation. Typically the system bars (which consist of the status and navigation bars, as shown in figure 1) are displayed concurrently with your app. Apps that display immersive content, such as movies or images, can temporarily dim …

Accessibility Testing Checklist in Android

Testing is an important part of making your application accessible to users with varying abilities. Following design and development guidelines for accessibility are important steps toward that goal, but testing for accessibility can uncover problems with user interaction that are not obvious during design and development. This accessibility testing checklist guides you through the important …