Please conduct the following tasks alone. For implementation details you can refer to the lecture slides or the Android developer website. Please do not hesitate to ask me or the tutor if you have any questions. Under “Tip” you can find some hints for the task. The “Checklist” specifies what should happen when your implementation is correct.
Implement an app with a Master and Detail view as shown below. The Master view should contain a simple list with some input. The detail view should show some text. Use the ListFragment class for implementing the Master view and the Fragment class for the Detail view. Create a second layout for the landscape mode where the Master view is on the left and the Detail view on the right (as shown on the left in the screenshot below). When the user turns the device in the landscape mode both fragments should be visible next to each other. In portrait mode the Master (ListFragment) is shown first and the Detail view is shown when a list item is picked by the user.
For the landscape mode create a folder called „layout-land“ below the folder “res”. Place your layout containing both fragments there. To turn the emulator into landscape mode press CTRL-F12 (fn-crtl-F12 on a Mac).
Checklist | |
---|---|
Layout changes correspondingly when device is turned into landscape mode |