Changes

Jump to: navigation, search

An Android Master/Detail Flow Tutorial

22 bytes added, 19:55, 27 October 2016
m
Text replacement - "<table border="0" cellspacing="0">" to "<table border="0" cellspacing="0" width="100%">"
<googlehtmlet>BUY_ANDROIDandroid44</googlehtmlet>
== The Master/Detail Flow ==
A master/detail flow is a an interface design concept whereby a list of items (referred to as the master list) is displayed to the user. On selecting an item from the list, additional information relating to that item is then presented to the user within a details panel. An email application might, for example, consist of a master list of received messages consisting of the address of the sender and the subject of the message. Upon selection of a message from the master list, the body of the email message would appear within the detail panel.
On tablet sized Android device displays, the master list appears in a narrow vertical panel along the left hand edge of the screen. The remainder of the display is devoted to the detail panel in an arrangement referred to as two-pane mode. Figure 23-1, for example, shows the master/detail two-pane arrangement with three master items listed and the content of item three listed in the detail panel:
Begin by launching Eclipse and selecting the File -> New -> Android Application menu option. Enter MasterDetailFlow as both the application and project name and specify a suitable package name (or com.example.masterdetailflow as a placeholder if you do not have a company URL).
Select the latest SDK for each of the SDK menu options (at time of writing this is Android 4.24) before clicking the Next button. Click Next to accept the defaults on the Configure Project and Configure Launcher Icon screens.
When the Create Activty screen appears select the Master/Detail Flow option as illustrated in Figure 23-3 before clicking on Next once again:
[[Image:creating_master_detail_flow_activityandroid_44_master_detail_template.png|Selecting the Master/Detail Flow Activity template]]
Figure 23-3
[[Image:master_detail_flow_object_kindandroid_44_master_detail_kinds.png|Configuring the object kind information for a Master/Detail Flow project]]
Figure 23-4
== The Anatomy of the Master/Detail Flow Template ==
<googlehtmlet>ADSDAQBOX_FLOWadsdaqbox_flow</googlehtmlet>
Once a new project has been created using the Master/Detail Flow template, a number of Java and XML layout resource files will have been created automatically. It is important to gain an understanding of these different files in order to be able to adapt the template to specific requirements. A review of the project within the Eclipse Package Explorer panel will reveal the following files, where <kind_name> is replaced by the Object Kind name that was specified when the project was created (this being “Website” in the case of the MasterDetailFlow example project):
<googlehtmlet>BUY_ANDROIDandroid44</googlehtmlet>
== Changing the Content Model ==
<uses-sdk
android:minSdkVersion="1719" android:targetSdkVersion="1719" />
.
.
<googlehtmlet>BUY_ANDROIDandroid44</googlehtmlet>
 
<htmlet>ezoicbottom</htmlet>
<hr>
<table border="0" cellspacing="0" width="100%">

Navigation menu