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.
You plan to develop a fitness app that allows to calculate the BMI of the user. In order to calculate the BMI the user has to input his size and weight. The app should then store this information in the shared preferences, so that when the app is started the next time, the user is directly shown his current BMI based on the given values. Write a little application that has two views (Activities): The main activity shows the current BMI and has a menu or button to open the settings view. The settings activity allows to set the height and weight value.
All values, the weight, age and height shall be stored in the shared preferences The BMI is then calculated as follows:
BMI = weight in kg/ (height in meter ^2)
Refer to the lecture slides on how to store data in the Shared Preferences
Checklist | |
---|---|
When the app starts the first time the BMI value is 0. After the user types in the size and height the BMI is calculated | |
When the app ist stopped or the device is turned off and the app is started again, the BMI is calculated upon the values loaded from the shared preferences. |
Implement an app, that allows you to take a picture and stores the picture on the external storage. Next the picture is loaded from the external storage an presented to the user as shown in the below screenshots.
Make sure you have the right permissions to write to the external storage. Select the proper output folder and be sure to use a FileProvider to get the proper URI to the output file when passing it to the Camera Activity. Use an implicit intent with the action ACTION_IMAGE_CAPTURE
from the MediaStore class to start the CameraActivity.
Checklist | |
---|---|
When the user presses a button, the CameraActivity is started and when the picture is taken it is displayed. |