Skip to content

softpian/RxJava-RESTfulAPI-Reddit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RxReddit

Reddit application implementing a RESTful API call with RxJava.

Introduction

RxJava

This repository contains a Reddit application based on Reactive Programming using RxJava.

The application shows how to implement a RESTFul API call with Retrofit and RxJava which extends the Observer pattern to support sequences of data/events.

RxJava Call adapter of Retrofit makes Observable object used for receiving a response instead of normal Call object.

Please refer to https://github.com/ReactiveX/RxJava for more detailed information.

Reddit RESTful API

This application uses RESTful API of Reddit which is a social news aggregation web site in order to get top 20 news posts.

It receives news data formatted in JSON and converts it to Java Objects including news title, photo url, author's name, date, comment's count and so on.

API Used

https://www.reddit.com/top.json?after=""&limit=20

Android development skills

This repository is able to help understand how to use the following skills.

  • How to integrate Retrofit with RxJava through RxJava Call adapter of Retrofit
  • How to call RESTful API with Retrofit
  • How to use OkHttp Logging Intercepter in order to debug HTTP request/response data
  • How to convert JSON to Java Objects with Moshi
  • How to load images from a remote server with Glide
  • How to reduce boilerplate codes with ButterKnife

Libraries Used

  • RxJava - Java VM implementation of Reactive Extensions
  • Retrofit - Type-safe HTTP client for Android and Java which makes it easier to consume RESTful API services.
  • Retrofit 2 RxJava 2 Adapter - Helps handle a response from server with RxJava as custom Call adapter
  • OkHttp Logging Intercepter - Logs HTTP request and response data with different logging levels in order to debug HTTP error
  • Moshi - JSON library for Android and Java which makes it easy to parse JSON into Java objects. Used with Retrofit Moshi converter
  • Glide - A fast and efficient image loading library for Android focused on smooth scrolling which offers an easy to use
  • ButterKnife - Binds field and method for Android views with annotation processing and it reduces boilerplate codes

Reference

License

Copyright Jaemoon Hwang <[email protected]>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

Reddit application implementing a RESTful API call with RxJava

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages