Skip to content

NewsLand Android App Project aims to be a good sample for learners and reference for developers which provides: Android Architectural Patterns (MVP - MVVM) Dependency Injection (Dagger2) Working with observers & observables (LiveData - RxJava)

License

Notifications You must be signed in to change notification settings

amrk000/NewsLand-MVP-MVVM-Android-Project

Repository files navigation

NewsLand Android App Project aims to be a good sample for learners and reference for developers which provides:

  • Android Architectural Patterns (MVP - MVVM)

  • Dependency Injection (Dagger2)

  • Working with observers & observables (LiveData - RxJava)


  • App Features:

    • Get Latest News Headlines
    • Read & Share news you like
    • See news in multiple languages & countries
    • Filter news to match your interrests using categories

    Implementation Highlights:

    • Rest API - Data Source: newsapi.org
    • Fetched & Parsed data with Retrofit + Gson + Glide
    • Blocking News with Room Persistence
    • Infinity Scrolling (Lazy Load) RecyclerView
    • MultiView (ViewHolder) RecyclerView Adapter
    • Realtime Network Checker with BoradcastReciever
    • Using & Handling WebView
    • ViewBinding android views
    • Implemented in Multiple Software Architectural Patterns
    • Di with Dagger2 (MVVM + DI)
    • Injecting ViewModels with Dagger 2 using Factory (MVVM + DI)
    • LiveData (MVVM)
    • RxJava (MVP)
    • UI Components:
      Chips, BottomSheet, RecyclerView, ListView, Swipe Refrech Layout, Snackbar

    Newsland.Preview.2.mp4

    Android Architectural Patterns:

    This Project is Implemented in Multiple Software Architectural Patterns using multiple tools to be a good sample for learner and reference for developer.


    Q&A:

    • Why using Architectural Pattern instead of writing code in activity?

      Architectural Patterns provide a better readability, modularity, scalability and maintainability so it's necessary to be used in projects that can scale and that have a team of developers working on it.

    • When not to use Architectural Pattern?

      Thats's only possible in personal or small projects.

    • Which Architectural Pattern is better for android MVP or MVVM?

      Both are good for android development but MVVM is the best choice right now and recommended by google. Although MVP is good too but it can't handle android lifecycle like MVVM.

    • MVVM Advantages over MVP?

      less code as it doesn't depend on interfaces, Android lifecycle aware, Easier unit testing with dependency injection.

    • MVP Advantages over MVVM?

      Easier to learn, Doesn't depend on google libraries, More flexible to new features & maintenance, Reactive programming is optional.

    • Why contract class isn't used in NewsLand MVP Version?

      Contract class is optional and you can use it in MVP but i prefer letting interfaces separated.

    • What is DataManager in NewsLand MVP Version?

      DataManager is an MVP extension layer which provides a clean API for accessing data from multiple sources and behaves like repository in MVVM.

    • Why ui folder/package isn't found in NewsLand MVVM Version?

      It's there! but i prefer calling it view.

    • What are ViewModelFactory, ViewModelModule classes in NewsLand MVVM + DI Version?

      These classes are used to be able to make viewmodels constructor injection using dagger2 as normal apporach can't be applied due to Dagger2 & ViewModels conflict.

    • Which is better LiveData or RxJava?

      LivData is the best when it comes to UI & Android lifecycle integration like in ViewModels. RxJava is provides more options so it's better when working with Non-Ui tasks, threads and multi requests like chain REST API Requests.

    • Can LiveData and RxJava be used together?

      Yes, as RxJava Provides stream conversion to LiveData.

    • What are BehaviorSubject, PublishSubject in RxJava?

      They are RxJava observables that behave as LiveData Objects.

About

NewsLand Android App Project aims to be a good sample for learners and reference for developers which provides: Android Architectural Patterns (MVP - MVVM) Dependency Injection (Dagger2) Working with observers & observables (LiveData - RxJava)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages