This project contains two Android apps which work together (API level 25). Here is a short summary of the apps:
-
MyApplication (A1) consists of a single activity containing two fragments. The first fragment consists of a list naming at least 6 Chicago landmarks (e.g., the Museum of Science and Industry, Wrigley Field, the Lincoln Park Zoo, etc.) Interactive app users can select one of the landmarks. When this happens, the selected item stays highlighted and the second fragment displays the web page of the highlighted item. This app also defines an options menu with at least two items: (1) exiting A1 and (2) launching the next application, Landmark Gallery (A2). A1 launches A2 by sending a system broadcast. In addition, application A1 maintains an action bar. The action bar shows the name of the application and the overflow area.
-
Application A2 is a picture repository; pictures are displayed in an Android Gallery. The gallery shows images from each of the landmarks discussed in application A1. A1 first starts the gallery in A2 by sending a global broadcast; A2 contains a broadcast receiver with appropriate filters to catch A1’s broadcast. When it receives a broadcast, A2 launches the gallery even though A2 was not running before A1 sent the broadcast. In addition, A2 defines a new, dangerous-level permission. The broadcast receiver contained in A2 requires that the broadcast sender (e.g., application A1) own this permission in order to respond to a broadcast. Use a meaningful and unique permission name of your choosing for the new permission. Also, make sure that A1 has the permission before sending the broadcast.
A1 has the following design: When the device is in portrait mode the two fragments are displayed on different screens. First, the device will show only the first fragment. When the user selects an item, the the first fragment disappears and the second fragment is shown. Pressing the “back” soft button on the device, will return the device to the original configuration (first fragment only), thereby allowing the user to select a different point of interest. When the device is in landscape mode, application A1 initially shows only the first fragment across the entire width of the screen. As soon as a user selects an item, the first fragment is “shrunk” to about 1/3 of the screen’s width. This fragment will appear in the left-hand side of the screen, with the second fragment taking up the remaining 2/3 of the display on the right. Again, pressing the “back” button will return the application to its initial configuration, showing the first fragment across the entire display. The action bar is displayed at all times regardless of whether the device is in portrait or landscape mode. Finally, the state of application A1 is retained across device rotations, e.g., when the device is switched from landscape to portrait mode and vice versa. This means that the selected list item (in the first fragment) and the page displayed in the second fragment will be kept during configuration changes.