The app 1. The app needs to show four images as shown below, describing your favourite foods. You are very welcome to customise what your app shows (in the past we've had favourite paintings, for...

1 answer below »
The assignment is to write an program in Kotlin laungauage. Attached the detailed description of it. The main goal is to complete the section named 'The app' in attached PDF, and then extension if time left.


The app 1. The app needs to show four images as shown below, describing your favourite foods. You are very welcome to customise what your app shows (in the past we've had favourite paintings, for example), as long as your report clearly states this and the images are not objectionable. Stick with food if you are not sure. 2. The data kept for each image should include the name of the food, the date the photo was taken, the type of cuisine, and a rating from 0-5 (you can alter these for other domains, e.g., name of painting instead of food name, artistic period for type of cuisine, but the data types must remain the same). You will need to create a model for this -- note data should not be stored to disk, rather kept in memory. The title and rating should be shown under each image in the first activity. For the extension, at least one of your attributes should use a non-TextView widget, such as a RatingBar, a Switch, or a RadioGroup. 3. When an image is clicked, a new screen with further details needs to be shown along with the image. The data needs to be passed as a Parcelable object. The non-TextView widget needs to show the correct value on activity creation. Explain the components of your Intent and the advantanges of using Parcelable objects on Android. 4. Your layout can be a grid as shown, in which case TableLayout might be useful. Otherwise Constraint or Linear layouts can be used, and images can be presented four in a row. My example is rather tricky and uses compound views -- this is only recommended for those with low frustration levels or the need to simplify their views, and you are welcome to use single views. 5. Additional requirements for this task are to demonstrate good use of Kotlin features in your code (such as scope functions) and to provide some simple sketches of the two screens in your app. The latter could be made using XD or Figma or could be freehand sketches. Please note that this does not mean "pretty" designs should be made -- it is simply testing whether you can use sketching tools to think about and communicate your app's UI. Extension 1. Turn the second activity into a form, and update the details for the images. In order to make life easy for your user, you should enter the existing text/values into the form for editing, rather than presenting empty inputs. The new details should be saved on pressing back (there should not be an explicit save button), and should be shown to the user in the first activity. Do not use persistent data for this task. 2. Keyboards should only show useful inputs for particular fields, such as dates for date strings. 3. Error checking should be included for required fields -- this could be length of string, valid dates, etc. 4. This is a good app for UI testing. Note that RatingBars are not easy to test with Espresso so you should focus on text and other widgets. Checklist • The app contains four images of reasonable size. • A model for the image data is used, which implements the Parcelable protocol, and is populated. • On an image click, details about that image are shown. • Code is commented, indented correctly, uses understandable variable names, shows some evidence of decomposition and design to avoid repeated code, makes use of Android practices, e.g., string resources instead of hard-coded strings, and makes use of Kotlin features, e.g., scope functions. • Sketches of your UX are included in the report. • As an extension, edit the data for a particular image and show this update in the first activity. UI tests are included. Tips • The tutorial exercises should cover the steps needed to make this app. Feel free to ask for forums for help using the tutorial exercises or other samples; code or step-by-step processes that are clearly related to this app should not be shared. • If you plan to go to D or HD, save the really fancy stuff for the later tasks! • Please do not use RecyclerViews or lists for this task. Fragments are not required either -- if you're not sure how to use them, leave them out. • One thing that has tripped up students with less programming experience in the past on a similar task is the structuring of the data. You need to create a Parcelable object anyway -- use this to store the data for each image (maybe have a function or even a separate object for initialising your data?), and then have a list or array of these in your main activity. • For more information on RatingBar, for those who want to use it, see https://developer.android.com/reference/android/widget/RatingBar (L inks to an external site.). In order to constrain the number of stars shown, check the layout_width setting. • To get the integer id for a resource, such as an image, resources.getIdentifier() might be useful. resources.getDrawable() will also be useful for showing an image given an integer id. • For more information on scope functions, see https://kotlinlang.org/docs/reference/scope-functions.html (Links to an external site.) • A Java-based tutorial on compound views can be found at https://www.vogella.com/tutorials/AndroidCustomViews/article.html (L inks to an external site.). https://developer.android.com/reference/android/widget/RatingBar https://developer.android.com/reference/android/widget/RatingBar https://kotlinlang.org/docs/reference/scope-functions.html https://kotlinlang.org/docs/reference/scope-functions.html https://www.vogella.com/tutorials/AndroidCustomViews/article.html https://www.vogella.com/tutorials/AndroidCustomViews/article.html
Answered Same DayOct 17, 2021

Answer To: The app 1. The app needs to show four images as shown below, describing your favourite foods. You...

Ayush answered on Oct 19 2021
145 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here