2023 Read Chapter 2 creating the HealthyRecipes app In this chapter you learn how | Assignment Collections

Computer Science 2023 mobile app

2023 Read Chapter 2 creating the HealthyRecipes app In this chapter you learn how | Assignment Collections

Read Chapter 2, creating the HealthyRecipes app.

In this chapter you learn how to put an image and a button on your layout.

No matter which development environment you use (Eclipse and add-ons, or Android Studio) this is what you do:

1. Put a TextView and ImageView and button on your layout (activity_main.xml) 

2. Create a second layout (recipe.xml) that has only TextViews on it

3. Create a java class (Recipe.java) to go with the second layout

4. Add a button listener to the java code for the main layout (i.e. add it to MainActivity.java) so that when the button is clicked the second layout (recipe.xml) appears. 

Android Studio handles things a little differently from the way the book says, but the main difference is that Eclipse had wizards and pop-ups that led you through creating some of these new features and saved you having to write the java code, whereas in Android Studio you have to type in the java code yourself. 

Here are the changes I found I had to make:

1. Adding an image. There is no drawable-hdpi folder as stated on page 44. Drag and drop your image (guacamole.png) into the folder called ‘drawable’. Then in the properties box of the ImageView go to src and type @drawable/guacamole  Note there is no .png. This puts the image in the ImageView

2. To add a layout, in your project right click on layout and choose New -> Layout Resource File. You should alter the layout from linear to relative.

3. To create a java class, in your project under java, right click on your package name (mine is called com.examples.jeanmehta.healthyrecipes) and choose New _> java class. Make sure this new class extends from the same class as MainActivity. 

public class Recipe extends AppCompatActivity

4. You have to alter the HealthyRecipes Manifest by hand (so ignore pages 55-57). Fig 2-19, page 54 shows you what it currently looks like.Then add the one line of code , line 25 on Figure 2-23, page 58.

 

5. It’s the same as the book from page 58 onwards. 

Run it on an emulator. You will find you cannot return from the second page (the ingredients and directions). On the emulator go to Menu ->Manage Apps -> HealthyRecipes ->Force close. This will allow you to run it a second time. 

(Sometimes you make a mistake and need to edit your app.

Using Eclipse: If you make changes in Eclipse and save them, you probably need to uninstall your app from the emulator before running your app again. To uninstall: Menu ->Manage Apps -> HealthyRecipes ->Uninstall.)

Using Android Studio: You can just run the app again and the new version will download onto the emulator

When you have finished HeathyRecipes, complete one of the end of chapter exercises that has one or two stars, and one that has three stars.

Grade: Healthy Recipes: 10 points

Either Case Project 2-1, 2-2, 2-3, or 2-4 (one or two star exercises) 10 points (The instructions are a little confusing, just follow the algorithm. It is ONE school, or ONE hostel and needs 2 layouts, one button, and 2 java classes).

Either Case Project 2-5 or 2-6 (three star exercises) 20 points  (These need your own images, 3 layouts, 3 java classes, and 2 buttons)

NOTE: Images must be in png format and the names must be all lowercase (I learned this the hard way!)

 

We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.

Place Order Now

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational