All Projects → hasancse91 → weather-app-android-mvvm

hasancse91 / weather-app-android-mvvm

Licence: other
Simple MVVM practice repository for very very beginners. You don't need to know about Dagger, Coroutine or Rx for understanding MVVM and this project. To check the MVVM Architecture Bengali Tutorial visit my blog site

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to weather-app-android-mvvm

Android-Kotlin-MVVM-Template
[In progress...] Chat APP | MVVM + Clean Architecture | Kotlin, LiveData, Koin, Databinding, Navigation Fragments, Rx, Room, Crashlytics, Circle CI config, commons classes for UI.
Stars: ✭ 314 (+881.25%)
Mutual labels:  viewmodel, mvvm-architecture, mvvm-android, livedata, livedata-viewmodel
Chat-App-Android
Chat app based on the MVVM architecture using Kotlin, ViewModel, LiveData, DataBinding and more.
Stars: ✭ 70 (+118.75%)
Mutual labels:  viewmodel, android-studio, mvvm-architecture, mvvm-android, livedata
AndroidCleanArchitecture
Android Project with clean android architecture contain Dagger, Retrofit, Retrofit, Android archtecture components, LiveData with MVVM architecture
Stars: ✭ 22 (-31.25%)
Mutual labels:  retrofit2, mvvm-architecture, mvvm-android, livedata
Jetpack Mvvm Best Practice
是 难得一见 的 Jetpack MVVM 最佳实践!在 以简驭繁 的代码中,对 视图控制器 乃至 标准化开发模式 形成正确、深入的理解!
Stars: ✭ 6,950 (+21618.75%)
Mutual labels:  mvvm-architecture, mvvm-android, livedata, livedata-viewmodel
News Sample App
A sample news app which demonstrates clean architecture and best practices for developing android app
Stars: ✭ 334 (+943.75%)
Mutual labels:  viewmodel, retrofit2, mvvm-architecture, livedata
MockAppMVVM
A sample app structure using the MVVM architecture using Retrofit, Dagger2, LiveData, RxJava, ViewModel and Room.
Stars: ✭ 14 (-56.25%)
Mutual labels:  viewmodel, retrofit2, mvvm-architecture, livedata
Foodium
It simply loads Posts data from API and stores it in persistence storage (i.e. SQLite Database). Posts will be always loaded from local database. Remote data (from API) and Local data is always synchronized.
Stars: ✭ 1,940 (+5962.5%)
Mutual labels:  retrofit2, mvvm-android, livedata, livedata-viewmodel
Movie Zone
movies application using MVVM Architecture
Stars: ✭ 25 (-21.87%)
Mutual labels:  viewmodel, retrofit2, mvvm-architecture, livedata
Moviefinderusingmvvm Android
🔥 MVVM + Clean Architecture + Best Practices | 🍿Movie Finder is a sample Android application 📱to search movies using OMDb API which is built to demonstrate use of Modern Android development tools - (Kotlin, Coroutines, Kodein, Architecture Components, MVVM, Retrofit, Gson, Material Components) 😊😊😉
Stars: ✭ 66 (+106.25%)
Mutual labels:  viewmodel, retrofit2, mvvm-architecture, livedata
Mvvmframe
🏰 MVVMFrame for Android 是一个基于Google官方推出的Architecture Components dependencies(现在叫JetPack){ Lifecycle,LiveData,ViewModel,Room } 构建的快速开发框架。有了MVVMFrame的加持,从此构建一个MVVM模式的项目变得快捷简单。
Stars: ✭ 218 (+581.25%)
Mutual labels:  viewmodel, retrofit2, mvvm-architecture, livedata
Dagger-Hilt-MVVM
Sample app that demonstrates the usage of Dagger Hilt with Kotlin & MVVM
Stars: ✭ 62 (+93.75%)
Mutual labels:  viewmodel, retrofit2, mvvm-architecture, livedata
Clean-MVVM-NewsApp
Android News app developed using Clean + MVVM architecture
Stars: ✭ 52 (+62.5%)
Mutual labels:  viewmodel, retrofit2, mvvm-architecture, livedata
Manime
🍱 An anime app, based on single activity and MVVM architecture.
Stars: ✭ 24 (-25%)
Mutual labels:  viewmodel, retrofit2, mvvm-architecture, livedata
Kriptofolio
Free open source minimalistic cryptocurrencies portfolio app for Android.
Stars: ✭ 79 (+146.88%)
Mutual labels:  viewmodel, mvvm-architecture, livedata
FindTaek
📦 내가 시킨 택배가 어디까지 왔는지 확인해보세요
Stars: ✭ 26 (-18.75%)
Mutual labels:  retrofit2, android-studio, mvvm-architecture
MVVM-Koin-Repository-Pattern
Experimenting with MVVM, Koin and Repository pattern in a simple TODO app.
Stars: ✭ 29 (-9.37%)
Mutual labels:  retrofit2, mvvm-architecture, mvvm-android
Kotlin-MVVM-JetPack
[DEPRECATED. USE https://github.com/egek92/Kotlin-MVVM-Jetpack-Hilt-Coroutines-Flow] Clean Android architecture guidelines that are based on MVVM + Offline 1st approach with LiveData and Room
Stars: ✭ 73 (+128.13%)
Mutual labels:  retrofit2, mvvm-architecture, livedata
Superhero-App
🦸🏻‍♂️🦹🏻‍♀️Superhero app built with Kotlin, ViewModel, LiveData, ViewBinding, Room, and Hilt
Stars: ✭ 27 (-15.62%)
Mutual labels:  viewmodel, retrofit2, livedata
Android-Mvi-Starter
Android MVI Starter application
Stars: ✭ 19 (-40.62%)
Mutual labels:  viewmodel, retrofit2, livedata
Simple-Notes-Kotlin-App
✍️ Simple Note Making App use mvvm architecture , dagger , coroutines and navigation component. Features includes 🗒️ create , edit and ❌ delete notes
Stars: ✭ 40 (+25%)
Mutual labels:  viewmodel, mvvm-architecture, livedata

Android MVVM Architecture Sample (ViewModel + LiveData + Kotlin + Retrofit) - Weather App

MVVM Architecture is one of the most popular and latest architecture to develop a maintanable and managable codebase. We are developing a sample Weater Forecast Android App with MVVM Architecture using Kotlin language and Retrofit network calling library. For simplification, I didn't use Dagger, Coroutine or Rx in this project. After completion of this repository, if you want to learn about Dagger implementation; please check this repository for MVVM and Dagger implementation.

Same weather app project is available for Flutter in this repository.

Prerequisites

Basic Kotlin and knowledge of HTTP request by Retrofit library are required for this project. If you already know MVP Architecture then this project will be very easy to understand. You can check my MVP Architecture Weather App repository from here. It will be helpful if you cover the MVP project then compare between MVP and MVVM.

Project Description

We will develop a weather forecast Android Application with MVP architecture. The UI will be as like as above screenshot. There is a Spinner with some City name. After selection a city user need to hit the View Weather button. Then App will send request to Open Weather web API and show the weather information in the UI.

Open Weather API

We will use Open Weather Map API for collecting weather information. To get the real weather information of a city, you need to sign up and get your own APP ID. Otherwise you can test the API with their sample BASE URL and sample APP ID without creating account.

Project Setup

Clone the project and open it using Android Studio. Then open your local.properties file under Gradle Scripts. You need to specify the base_url and app_id in your local.properties file. Store your API secret in plain string file or Kotlin file is very risky. For security purpose it's better store in local.properties file than plain string/Kotlin file.

Use Sample API without creating account

Add below lines at the end of your local.properties file. Then run the project. You'll get dummy or static API response from Open Weather API.

#this is sample Base URL
base_url=https://samples.openweathermap.org/data/2.5/

#this is sample App ID of Open Weather API
app_id=b6907d289e10d714a6e88b30761fae22

Use Real APP ID after sign up and activation of your APP ID

After Sign up at the website collect your own APP ID from their API Keys page. Then add below lines with your APP ID at the end of local.properties file.

#this is real Base URL
base_url=http://api.openweathermap.org/data/2.5/

#this is real App ID of Open Weather API
app_id=YOUR_OWN_APP_ID

The BASE URL and APP ID will be fetched from build.gradle file and will be stored it in BuildConfig. And Retrofit API call will use the BASE URL and APP ID from BuildConfig.

Note: The free version of Open Weather API allows maximum 60 API calls per minute.

Run the project

Sync the Gradle and run the project. Install APK on your emulator or real device. Turn on the internet of your testing device. For better understanding, please read the comments of every methods. Hope, these comments will help you to feel the MVVM Architecture.

Disclaimer

There are some other ways of implementation of MVVM. We find most of the MVVM tutorials are covered with Rx and Dagger. But it's not mandatory to use Rx or Dagger in MVVM. Even without using LiveData you can implement MVVM architecture. The main difference between MVP and MVVM is: Presenter is not Life Cycle aware. On the otherhand ViewModel is Life Cycle aware.

For simplicity, I've ignored reactive programming concept (Rx) and dependency injection in this project. I have created another repository of MVVM with dependency injection Dagger 2. In future I will create another repository with Rx.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].