Practical exercises to ensure that the basis of the chapter has been understood
The assignment is mandatory for a passing grade in the course.
Create an app to convert values between different units. Let's pick conversion of speed between kilometers per hour and miles per hour, and weight betweeen kilograms and pounds, but feel free to choose some other units and conversions if you want.
Perform this optional assignment to get one (1) extra credit.
Create a similar app to the previous assignment. However, instead of using an EditText for specifying the source value, it will have four buttons that add different amounts to the source value or resets it back to zero. The type of conversion will also be specified by a Spinner instead of the previous four buttons.
The Spinner will be used to choose the type of conversion. Create a string array as an XML resource file with the four different types of conversion that can be made: "mph to km/h", "km/h to mph", "pounds to kilograms" and "kilograms to pounds". Reference the string array resource from the Spinner so that it will display the options to the user.
Now they will contain the following for texts instead: "0", "+50", "+10" and "+1". Each button text represents how much the source value will change, when the button is pressed. The button "0" will set the source value to zero. The idea is that the user can use these buttons to define any value the user wants to convert, and that this might be easier and faster than using the numerical keyboard and the previous EditText.
by creating a resource XML file with a style containing at least two different attributes, like "android:layout_margin" and "android:background". Or whatever you like. Feel free to use your imagination. The important part is that you can create the styles.xml file correctly and then reference it for each of the four buttons to have them receive the same style attributes as you've defined in the styles.xml file.
Create a new resource folder in the project where the qualifier orientation is landscape. Add a layout XML file to that folder and paste a copy of the XML from the existing layout and then make changes so everything on the screen will be better layed out for landscape. The current layout before this step is good enough for portrait orientation but will probably feel very cramped in landscape. Exactly how you do that, or what you change, is up to you.