Changes

Jump to: navigation, search

Using Fragments in Android - A Worked Example

49 bytes removed, 19:46, 26 June 2013
no edit summary
The two fragments will be embedded within the main activity of the application and communication implemented such that when the button in the first fragment is pressed, the text entered into the EditText view will appear on the TextView of the second fragment using a font size dictated by the position of the SeekBar in the first fragment.
Since this application will be required to work on all generations of the Kindle Fire device familyearlier versions of Android, it will also be necessary to make use of the appropriate Android support library.
== Creating the Example Project ==
== Adding the Android Support Library ==
As previously discussed, support for fragments was not introduced until Android 3.0. This means that for applications that make use of fragments to be compatible with the first generation Kindle Fireolder versions of Android, use must be made of version 4 of the Android Support Library. The purpose of the Android Support Library is to make features that were introduced in later versions of Android available to applications that need to be compatible with earlier Android versions.
Assuming that the installation steps outlined in the chapter entitled [[Setting up a Kindle Fire an Android Development Environment]] were followed, then the Android Support Library package should already be installed on your development system. To verify this, launch Eclipse and select the Window -> Android SDK Manager menu option. When the manager window has appeared on the screen, scroll down to the Extras section and make sure that the column to the far right of the Kindle Fire Android Support Library item is listed as Installed as shown in Figure 22-1:
<table border="0" cellspacing="0" width="100%">
<tr>
<td width="20%">[[An Introduction to Android Fragments|Previous]]<td align="center">[[Android 4 App Development Essentials|Table of Contents]]<td width="20%" align="right">[[Creating and Managing An Android Overflow Menus on the Kindle FireMaster/Detail Flow Tutorial|Next]]</td>
<tr>
<td width="20%">An Introduction to Android Fragments<td align="center"><td width="20%" align="right">An Android Master/Detail Flow Tutorial</td>
</table>

Navigation menu