Git Product home page Git Product logo

baking_time's Introduction

Baking time!

This repo contains all the work done for the Baking App project of the Udacity's Android Developer Nanodegree.

Application description

This app shows different cake recipes and the steps and ingredients needed for baking them.

The user is able to navigate the app selecting the desired recipe and its different steps to obtain the information needed in order to bake this delicious cakes!

Application details

The first time the application is launched, it obtains the recipe information from the internet and store it in a database. See Database schema section for more info about this

The application has three Activities:

  • MainActivity
  • DetailRecipeActivity
  • StepDetailAcivty

The flow between them is the following:

In MainActivity the recipe's name and serving is presented to the user using a Fragment (RecipeListFragment).

Once the user clicks in a recipe. a DetailRecipeActivity is opened. Here the recipe's ingredients and steps are shown using two fragments (IngredientListFragment and StepListFragments). The recipe information is obtained using a ViewModel object. It firs checks the database and if there is no information, it gets the recipe information from the internet. The use of a ViewModel for this purpose guarantees that the information is going to be recovered/stored correctly even if an event such as a screen rotation happens.

The user is able to click in one of the steps to launch a StepDetailActivity containing a video illustrating how to perform the step (VideoFramgent) and a more detail description about it (StepDetailFragment). The user is able to navigate between the steps with a previous and next button. In larger devices such as tablets, the step video and description will be shown as well.

Database schema

For storing the recipe data in a database Room has been used. For more details about database structure please see the recipe module and for more information about the database implementation see the database module

The database used contains three tables:

Recipe Ingredient Step Selected recipe
int id //@key int key //@key int key //@key autogenerate int key = 1; //@key
String name float quantity int id int index
String servings String measure String shortDescription -
String name String ingredientName String description -
- int recipeId //@Foreign key String videoURL -
- - int recipeId //@Foreign key -

The recipe table doesn't contain any information related to the ingredients or steps. Both, Ingredient and Step, contain a index of their recipe as foreign key.

The Selected Recipe represents the current recipe selected by the user. This is used in the application's widget to retrieve its ingredients

Android testing

There are four test classes with Intrument tests within the com.example.backing_app(androidTest) package. Some of this tests are specific to small devices (smartphone) and another for large devices(tablets).

  • MainActivityTest: Test in both
  • MainActivityIntentTest: Test in both
  • RecipeDetailActivityTest: Test in both
  • RecipeDetailActivityIntentTest: Test in smartphone (RecipeDetailActiviy doesn't launch StepDetailActiviy in large devices)
  • StepDetailActivityTest: Test in smartphone (StepDetailActivity is not accessible in large devices)
  • StepDetailActivityIntentTest:Test in smartphone (StepDetailActivity is not accessible in large devices)

Screenshots

Please see here the full screenshot set

mainActivityPortrait recipeDetailPortrait

recipeDetailActivityTabletPortrait

Relevant libraries used

External resources

The image shown where a step doesn't contain a video was obtained from here

The logos shown in the RecipeDetailActivity are the following:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.