RUVIDEO
Поделитесь видео 🙏

Android REST Tutorial - OKHttp Error Interceptors, RxJava 2, Repository Pattern, Retrofit

In this tutorial series, I'll be explaining the fundamentals of RESTful Web Services, and what the hell that actually means. In particular, I'll be demonstrating how to build a basic REST API to pull Repository Data from GitHub's REST Endpoint. We'll use Retrofit, OKHttp, and a bit of RxJava magic to make it all work nicely.

In this video, we look at a number of ways to improve our Retrofit Implementation, and how to wire the "back end" of our App to our "front end", using RxJava 2 and the Repository Pattern. If you're new to Rx, the latter half will be difficult. I go through it line by line though, so I might be able to shed some light on it.

Timestamps:
0:00 - Introduction
1:47 - Adding an Application level Interceptor to help handle REST Adapter Errors (Note: errors thrown here will propagate to our RxJava Implementation)
6:50 - A brief explanation of the Repository Pattern, and why it helps us to write better code with very little overhead (seriously, start doing this if you aren't).
8:30 - How and why you might want different "DataModels" for the Front End and Back End of your Application (we'll use RxJava's FlatMap later to actually implement this solution, but I needed to introduce this before we can write the actual Rx stuff)
13:36 - How and why we might want to use RxJava 2 to wire up our Front End and Back End, handle errors, and manage view state.
16:08 - Writing our DataSourceInterface (This is what our Presenter will talk to) and wtf is a Flowable?
18:43 - Writing our Presenter.
37:48 - Writing our DataSourceImplementation. This thing is the Repository Pattern you keep hearing about; it allows us to hide implementation details of our back end, allowing us to change it at will without needing to change the Presenter (unless the Interface itself changes).
40:57 - Using FlatMap to transform our Data into a new type of Flowable (this is where we change DataModels).
48:47 - Building and Deploying the Project (I had to fix a few improper import errors to get it to build, you may have to do the same. It's an unfortunate side-effect of having two duplicate modules in one project).
50:03 - Outro and some more explanation of what our RxJava 2 Implementation actual did for us.

Project Repository:
https://github.com/BracketCove/AndroidRestTutorial

Looking for a brief introduction to building Android, Software Architecture, and Object Oriented Programming/Design? Check out my ebook:
http://wiseassblog.com/products/

Livestream on Sundays (9:00am GMT -7)
http://www.youtube.com/c/wiseAss/live

Patreon: https://www.patreon.com/bePatron?u=5114325

Github: https://github.com/BracketCove

Facebook: https://www.facebook.com/wiseassblog/

G+: https://plus.google.com/+wiseass

Twitter: https://twitter.com/wiseass301

Blog: http://wiseassblog.com/

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Android REST Tutorial - OKHttp Error Interceptors, RxJava 2, Repository Pattern, Retrofit», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.