-
Title:
Quick Code Overview
-
Description:
-
Let's take a quick look
at the layout of the app.
-
Here are the Java classes.
-
The Dinner class has methods for
figuring out what dinner to suggest.
-
The MainActivity shows the main screen.
-
To start with the main screen only has
this one button, What's for dinner?
-
And when you press the button
it fires off an intent
-
to the show dinner activity.
-
So the dinner shows here and
then you get these buttons.
-
And each of these buttons fires off
an intent to start the appropriate
-
activity.
-
So for example,
-
the Show Recipe button sends an intent
to start the show recipe activity.
-
And actually, Choose Again does
not have a corresponding activity,
-
it just has a method inside the class.
-
Now this class here,
the useInfoBoxFragment
-
is a fragment that simply displays
an info box and a heading.
-
This lets you reuse the fragment
wherever you need it, and
-
helps simplify the code.
-
And for example, the showRecipeActivity,
the removeMealActivity,
-
the orderDinnerActivity,
all these activities use this fragment.
-
And the app has a couple of menus.
-
There's the main menu,
which just shows the settings.
-
But actually, we're not going to use
the settings in this application.
-
More interestingly, the food prefs menu,
displays a list of food options.
-
This pop-up is used whenever we want
the user, choose the food preference.
-
There's one other quick
thing I want to mention.
-
In the intro lesson to this
course you learned how to
-
implement the unconnected code to
use the Google API Client Library.
-
However, for both Google Analytics and
Google Tag Manager,
-
you do not need to implement any code
to use the Google API Client Library.
-
All the app needs is to specify
the version of the client library
-
in the android manifest, like this.
-
And to specify the dependency on
play-services in the build.gradle file.
-
And these dependencies have already
been set up for you in the What's For
-
Dinner sample app.