RxJava for Android Developers
eBook - ePub

RxJava for Android Developers

Timo Tuominen

Buch teilen
  1. English
  2. ePUB (handyfreundlich)
  3. Über iOS und Android verfügbar
eBook - ePub

RxJava for Android Developers

Timo Tuominen

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

RxJava for Android Developers teaches you how to build fast, fluid, and reactive mobile apps for Android with RxJava.

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist RxJava for Android Developers als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu RxJava for Android Developers von Timo Tuominen im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Diseño & Diseño UI/UX. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Jahr
2019
ISBN
9781617293368

Part 1. Core reactive programming

In this part
  • This book begins with getting you comfortable using your new tools—RxJava and a couple of libraries to support it.
  • The first chapter starts with a concrete example that will give you quick wins with the reactive style of programming.
  • Chapter 2 explores the typical case of handling network requests with RxJava and Retrofit. You’ll start to see the different mental models of the way data is processed, as in chapter 3 you’ll explore a credit card example with data processing chains. In chapter 4, you’ll construct a fully functioning Flickr client against an existing public API.
  • In the last chapter of the first part, chapter 5, you’ll work with an Android file browser. The code from this chapter will serve as the starting point for the second part of this book.
“Life is 10% what happens to you and 90% how you react to it.”
Charles R. Swindoll

Chapter 1. Introduction to reactive programming

In this chapter
  • What to expect from this book
  • How to use this book
  • Why RxJava 2 for Android?
  • Deep dive in to RxJava 2 on Android

Perhaps you picked up this book because...

1 Everyone’s using RxJava and you have no idea why.
It’s hard to name a large company that would do native Android and not use a reactive programming library such as RxJava 2. In this book you’lll focus on why it’s hot and what you can do with it.
You may also have heard of functional reactive programming (FRP), which is indeed related to Rx. You’ll learn about both concepts in this book.
2 You’ve used RxJava on Android and want to learn more.
It’s common these days to see snippets of RxJava code that solve a particular asynchronous problem. But a whole world lies behind what sometimes looks like a simple utility.
The programming syntax used in Rx can seem like the entire point, but it’s just a nice add-on. This book will teach you how to think in Rx.
3 You’ve used RxJava and hate it with a passion.
In the wrong hands, RxJava can make traditional spaghetti code even worse. With any power comes responsibility. You’ll learn where to use RxJava and where not.
You’ll learn to design applications in a sensible and extensible way. You can be reassured there’s a way to maintain your Rx code.

Whatever your reason, I want you to...

  • Learn through extensive illustrations and examples
  • Understand a new way of seeing how applications work
  • Figure out where to fit Rx in your day-to-day programming

Don’t read this book if...

You’re new to programming.
Rx is still a new paradigm, and it isn’t always smooth sailing. Hopefully in the future this will change, and everyone will start their programming journey with Rx.
  • or
“I just need to get it done.”
The learning curve of reactive programming is a little steeper than usual. Cutting corners isn’t as easy as in the more traditional ways of writing applications. This is fundamentally double-edged, but you’ll need a curious mind and a healthy dose of patience.
  • but
Continue reading if you want to learn how to properly make a delayed auto search field in five lines.
This is the example code you’ll learn to make in the first chapter. I don’t expect you to be able follow just yet, but take it as a preview of how powerful RxJava can be.
RxTextView.textChanges(textInput) 1 .filter(text -> text.length() >= 3) 1 .debounce(150, TimeUnit.MILLISECONDS) 1 .observeOn(AndroidSchedulers.mainThread()) 1 .subscribe(this::updateSearchResults); 1
  • 1 You’ll spend the first chapter constructing this piece of code.

OOP, Rx, FP, and FRP

RxJava is in the club of reactive programming libraries (http://reactivex.io/). They all start with Rx, so sometimes they’re together called Rx programming. To get an idea of where this sits, let’s recap the popular paradigms.

OOP, object-oriented programming

The idea of OOP is that everything is an object, a thing, and can interact with other objects. Typically, an object encapsulates its state and allows outside actors to modify it through its member functions.

FP, functional programming

Functional programming is an old programming style that focuses on an almost mathematical precision in describing the program. It turns out that although the mental model of FP seems more complex than OOP, it seems to scale better when the complexity of the state needed increases.

FRP, functional reactive programming

The concept of FRP was introduced 1997, but it has become popular only in recent years. It’s a bit like an extension on top of FP, enabling an app to be built to react to input in a seamless way. FRP does this by declaring relationships between values.

Rx, reactive programming

Reactive programming, sometimes called Rx for Reactive Extensions, is an umbrella term for all paradigms that use a data flow to construct the application. RxJava is our tool of choice to implement the data flow in practice. The previous term, FRP, can also be considered reactive programming, but not always the other way around.
What about the Facebook React library?
React is the name of a Facebook UI library made on top of HTML5. Although the concept of programming with React is similar to ours, it isn’t considered reactive in the way we define it.

Benefits of Rx

Rx, including RxJava, isn’t a typical technology that’s made to replace another infer...

Inhaltsverzeichnis