Support files, eBooks, discount offers, and more
For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at > for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.
Why subscribe?
- Fully searchable across every book published by Packt
- Copy and paste, print, and bookmark content
- On demand and accessible via a web browser
Free access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access.
Preface
In a world where there is a smartphone in every pocket, designing and building applications that can run smoothly and provide a user experience that users will enjoy is the only way to go. The reactive programming style with RxJava will help you beat Android Platform limitations to create astonishing Android Apps.
This book will be a practical journey, from the basics of reactive programming and Observer pattern concepts, to the main feature of RxJava, which will be accompanied by practical code examples and a real-world app.
I'll show you how to create an Observable from "scratch", from a list, or from a function that we already have in our codebase. You will learn how to filter an Observable sequence to create a new sequence, containing only the values we want; you will also learn how to apply a function to an Observable and how to concatenate, merge, or zip Observables. I'll show you how to enjoy RxAndroid Schedulers to overcome the threading and concurrency hell in Android.
The book will wind up with a practical example of RxJava combined with Retrofit to easily communicate with a REST API.
What this book covers
, RX from .NET to RxJava , takes initial steps into the reactive world. We will compare the reactive approach with the classic approach, and will explore the similarities and differences between them.
, Why Observables? , gives an overview of the Observer pattern, how it's implemented and extended by RxJava, what an Observable is, and how Observables relate to Iterables.
, Hello Reactive World , uses what we have learned so far to create our first reactive Android app.
, Filtering Observables , dives into the essence of an Observable sequence: filtering. We will also learn how to select only the values we want from an emitting Observable, how to obtain a finite number of values, how to handle overflow scenarios, and a few more useful tricks.
, Transforming Observables , shows how to transform Observable sequences to create sequences that can fit our needs.
, Combining Observables , digs into combining functions, and we are going to learn how to work with multiple Observables simultaneously when we create the Observable we want.
, Schedulers Defeating the Android MainThread Issue , shows you how to work with multithreading and concurrent programming using RxJava Schedulers. We will create network operations, memory accesses, and time-consuming tasks in a reactive way.
, REST in Peace RxJava and Retrofit , teaches you how Retrofit by Square can be used with RxJava to create an REST client efficiently and effectively.
What you need for this book
To run the examples in this book, you will need a standard Android development environment: