/Recipe_App_MVP

Building a Recipe App with the MealDB API using the MVP Architecture pattern.

Primary LanguageJavaApache License 2.0Apache-2.0

Recipe_App🥗🥘

This is Native Java Android App is based on the data that is fetched from TheMealDB Api (link)

Under active development👨‍💻


Screenshots📷

Loading Screen with Shimmer Main Interface On Tap on any card(loading..)
Catagory Interface On Scroll Data Fetched from Api On tap on any Item(loading..) Detail Interface

Dependencies


• Butterknife(More Info)

Field and method binding for Android views which uses annotation processing to generate boilerplate code for you.

  • Eliminate findViewById calls by using @BindView on fields.
  • Group multiple views in a list or array. Operate on all of them at once with actions, setters, or properties.
  • Eliminate anonymous inner-classes for listeners by annotating methods with @OnClick and others.
  • Eliminate resource lookups by using resource annotations on fields

    Note: This tool is now deprecated.
  android {
  ...
  // Butterknife requires Java 8.
  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }
}

dependencies {
  implementation 'com.jakewharton:butterknife:10.2.1'
  annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
}

• Retrofit2 (More Info)

A type-safe HTTP client for Android and Java.

Note: Retrofit requires at minimum Java 8+ or Android API 21+.
Dependency for Retrofit:

com.squareup.retrofit2:retrofit:2.9.0

Depencency for Retrofit Gson Converter:

implementation 'com.squareup.retrofit2:converter-gson:2.9.0'

• Picasso (More Info)

A powerful image downloading and caching library for Android

implementation 'com.squareup.picasso:picasso:2.71828'

• Shimmer FB(More Info)

Shimmer is an Android library that provides an easy way to add a shimmer effect to any view in your Android app. It is useful as an unobtrusive loading indicator, and was originally developed for Facebook Home.

implementation 'com.facebook.shimmer:shimmer:0.5.0'

Design Architechture - Model–view–presenter(MVP)

Model–view–presenter (MVP) is a derivation of the model–view–controller (MVC) architectural pattern which mostly used for building user interfaces MVP is an architecture pattern that you can use to deal with some of the shortcomings of MVC, and is a good alternative architecture. It provides an easy way to think about the structure of your app. It provides modularity, testability and, in general, a more clean and maintainable codebase.

Picking apart the acronym, MVP is composed of the following components:

Model:

The model will continue to contain the data in simple classes, so nothing really changes here.

View:

The view will continue to be implemented using Activity or Fragment classes, but we will change the scope of what the view controls.

Presenter:

The last part is the presenter, which handles UI updates based on changes to the data model, and also processes users inputs. The presenter will contain much of the business code and replaces the controller from MVC.

In MVP, instead of having a controller Activity class which handles both changes to the model and what’s displayed on screen, the controller and view parts are separated out, and the both the presenter and view become more lightweight.

Data (model) and UI (view), only communicate with one another through an intermediary (the presenter) . The presenter contains the bulk of the business logic, while the view focuses on how to display the data. The controller responsibility is now split between the view and presenter. A presenter handles the flow of data, and abstracts away the business logic from the controller. The Android-specific code stays in the view layer, and the presenter can be tested independently from the Android SDK.

So how does data flow between these components? Take a look at this diagram:

How To Run This

<> Open your terminal (NOTE: git bash prefered/ Terminal on Android Studio/Any Other Editor)
<> Run the git clone command and clone this repo.
<> Navigate to the project folder where you have cloned the repo.
<> Sync the project.
<> Open an emulator or plug in a real device
<> Run the App

Contributing

Feel Free To Contribute

Pull request are most welcomed, Add proper documentation to the part you contribute, Give me some time to review pull request Thank you.

Developed And Maintained by

😎Debanshu777

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Getting Started

To get started read the Android developers documentation