Android Kotlin: Forecast App 03 - Local Database (Room Entity & Dao) - MVVM Tutorial Course

Reso Coder
Reso Coder
41.8 هزار بار بازدید - 6 سال پیش - 📗 Get the code from
📗 Get the code from this tutorial 👇👇
https://resocoder.com/forecast-app-03

Start saving time now by planning weekly with Week Sweep: http://bit.ly/2Jf3QA0

In the last episode we made a Retrofit service to fetch data from the weather API. We also used Gson to convert this data from JSON to Kotlin objects.

We could technically use only this Retrofit service and create a nice user interface to display all the data we are currently getting. Doing this wouldn't be really performant and efficient though. What if the user doesn't have an internet connection? Do we even really need to fetch data from the server every time the app is launched? Shouldn't we cache all of this data?

The answer is YES! In this tutorial you are going to learn how to create a local SQLite database using the Room library. By the end of this tutorial, you will understand terms like entity or data access object (dao).

Go to my website for more information, code examples and articles:
http://resocoder.com

Follow me on social media:
Facebook: resocoder
Twitter: resocoder
6 سال پیش در تاریخ 1397/08/12 منتشر شده است.
41,810 بـار بازدید شده
... بیشتر