Fragments for older Android devices

As we discussed earlier, the Fragment API was added in Android 3.0 API level 11. In the POIApp example discussed so far, I have assumed that the user who tests my application will be using Android 3.0 or later. However, if your business demands that you support your app for older devices, then you can still take advantage of the new Fragment API classes.

As there is some portion of the market still running on 3.0, Google provides support libraries that allow you to implement fragments while maintaining backward compatibility. The Fragment features are available in the V4 support library, and it works in Android 1.6 API level 4.

You cannot directly use the Fragment class as we have used it in this chapter. You ...

Get Xamarin Mobile Application Development for Android - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.