ITIS/ITCS 5180 Mobile Application Development Homework 04 solved

$35.00 $21.00


5/5 - (1 vote)

Homework 04 (100 Points)
In this assignment you will revisit “RecipePuppy recipe finder” app. The App displays
recipes from Recipe Puppy ( This allows you to search
the recipes of the dish you are interested in, with proper ingredients. In this assignment,
you will learn how to use fragments instead of multiple activities.
The base URL of the API is: An example URL is: http://,garlic&q=omelet .
You can load the URL in for better understanding of
JSON you receive.
In this assignment we will build two fragments. The first screen is to search, and the
second screen is to display the results of the recipe search.
Search Screen (40 Points)
You need to implement the following:
1. An EditText to put the dish name.
2. A scrollable add ingredients panel which can add up to 5 ingredients in total.
Page 2 of 3
(a)Search Screen (b) Added a list of
(c) Loading recipes (d) Display recipes
Figure 1, App Wireframe
Recipe Puppy
Add Ingredients
Title: Monterey Turkey Omelet
butter, eggs, garlic, green pepper, monterey
jack cheese, icons, turkey, water
Recipe Puppy
Add Ingredients
3. The panel to add ingredients should be implemented using RecyclerView, see figure
1 (b).
4. It should display an empty EditText, and a floating action Add button. Once, you add
one ingredient, the floating action button should be changed from Add to Remove
button. Follow figure 1(b).
5. Then you need to create the URL as:
6. There should be a Search button. Clicking on that button should take you to the
Display recipes screen where it displays a list of recipes.
Recipes Screen (60 Points)
1. Use an AsyncTask or Thread pool to communicate with the RecipePuppy api and to
parse the result. Do not use the main thread to parse them.
2. In our example, we wanted to search for a Omelet recipe having two key ingredients:
Onions, and Garlic.
3. In received JSON, you will find that there are two levels of the hierarchy. Inside
“array”, you will find “results”. You need to parse all the items in results.
4. Use AsyncTask or Thread pool to retrieve and parse it.
5. You need to implement a ProgressBar to display the progress while it is parsing, see
figure 1(c). You can do it using a different fragment.
6. Finally display your result. Please follow the instructions:
• The whole list of results should be displayed in a horizontal Recycler/CardView.
• You have four things to display in each item:
• Title (“title” in JSON)
• Recipe image (“thumbnail” in JSON)
• Ingredients (“ingredients” in JSON)
• URL (“href” in JSON)
• You need to use a separate AsyncTask when you load the image. Alternatively, you
can use Picasso library to load the image. (
• The URL should be clickable, use implicit intents to open it in browsers.
• f no recipe is found, return to the main screen and toast to report that there were no
recipes found.
• Clicking on Finish button should Finish the second screen and return you to the
main screen.
7. Do not use the default Back Button options, override the method to use the
Page 3 of 3