Mobile App Dev 2021W: Assignment 3: Difference between revisions
No edit summary |
|||
(8 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
In this assignment you will be analyzing and extending [https://homeostasis.scs.carleton.ca/~soma/mad-2021w/code/Converter2A.zip Converter2A] from [[Mobile App Dev 2021W: Tutorial 6|Tutorial 6]]. | |||
This assignment has 20 points in 8 questions. Please submit your answers using the [https://homeostasis.scs.carleton.ca/~soma/mad-2021w/templates/assign3-template.txt supplied template]. Your answers are due via cuLearn on '''March 28, 2021'''. | |||
==Tasks== | ==Tasks== | ||
# [2] Add debugging log messages that report on | # [2] Add debugging log messages that report on activity lifecycle events. The log key should be "Converter2A". | ||
# [2] Add a Farenheit to Kelvin conversion, making sure that the conversion fails if the converted value would be less than 0 Kelvin (as nothing can be colder than absolute zero). What does the app do when you give it -500F and you ask it to convert to Kelvin (with no other changes)? Why? | # [2] Add a Farenheit to Kelvin conversion, making sure that the conversion fails if the converted value would be less than 0 Kelvin (as nothing can be colder than absolute zero). What does the app do when you give it -500F and you ask it to convert to Kelvin (with no other changes)? Why? | ||
# [2] Add an entry to the menu "Cars to Cows" that has no corresponding conversion by modifying the conversions map. | # [2] Add an entry to the menu "Cars to Cows" that has no corresponding conversion by modifying the conversions map. | ||
# [4] The "Cars to Cows" conversion still allows input to be entered, and that input is ''sometimes'' converted to another value. Why does this happen? How can you change the code so the input field is only active when a valid menu selection is made? | # [4] The "Cars to Cows" conversion still allows input to be entered, and that input is ''sometimes'' converted to another value. Why does this happen? How can you change the code so the input field is only active when a valid menu selection is made? | ||
# [2] Converter2A's layout is messed up when in landscape mode (the device turned horizontally). Why? What is wrong with the current layout? | # [2] Converter2A's layout is messed up when in landscape mode (the device turned horizontally). Why? What is wrong with the current layout? | ||
# [2] Fix Converter2A's layout by converting it to a LinearLayout. | # [2] Fix Converter2A's layout by converting it to a LinearLayout. You don't need to keep spacing the same, just make sure it looks reasonable in portrait and landscape modes. | ||
# [2] Fix Converter2A's layout while keeping it a ConstrainedLayout. | # [2] Fix Converter2A's layout while keeping it a ConstrainedLayout. You don't need to keep spacing the same, just make sure it looks reasonable in portrait and landscape modes. | ||
# [4] When rotated, Converter2A doesn't remember the current state of the app. Modify it so it saves and restores the selected conversion and the value being input when the main activity is destroyed and re-created. | # [4] When rotated, Converter2A doesn't remember the current state of the app. Modify it so it saves and restores the selected conversion and the value being input when the main activity is destroyed and re-created. | ||
==Solutions== | |||
[https://homeostasis.scs.carleton.ca/~soma/mad-2021w/solutions/assign3-sol.txt Assignment 3 solutions] |
Latest revision as of 15:20, 31 March 2021
In this assignment you will be analyzing and extending Converter2A from Tutorial 6.
This assignment has 20 points in 8 questions. Please submit your answers using the supplied template. Your answers are due via cuLearn on March 28, 2021.
Tasks
- [2] Add debugging log messages that report on activity lifecycle events. The log key should be "Converter2A".
- [2] Add a Farenheit to Kelvin conversion, making sure that the conversion fails if the converted value would be less than 0 Kelvin (as nothing can be colder than absolute zero). What does the app do when you give it -500F and you ask it to convert to Kelvin (with no other changes)? Why?
- [2] Add an entry to the menu "Cars to Cows" that has no corresponding conversion by modifying the conversions map.
- [4] The "Cars to Cows" conversion still allows input to be entered, and that input is sometimes converted to another value. Why does this happen? How can you change the code so the input field is only active when a valid menu selection is made?
- [2] Converter2A's layout is messed up when in landscape mode (the device turned horizontally). Why? What is wrong with the current layout?
- [2] Fix Converter2A's layout by converting it to a LinearLayout. You don't need to keep spacing the same, just make sure it looks reasonable in portrait and landscape modes.
- [2] Fix Converter2A's layout while keeping it a ConstrainedLayout. You don't need to keep spacing the same, just make sure it looks reasonable in portrait and landscape modes.
- [4] When rotated, Converter2A doesn't remember the current state of the app. Modify it so it saves and restores the selected conversion and the value being input when the main activity is destroyed and re-created.