O'Reilly logo

RxJava Essentials by Ivan Morgillo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Executing a network task

Networking is part of probably 99 percent of mobile apps nowadays: we always need to connect to a remote server to retrieve the information we need in our app.

As a first approach to networking, we are going to create a new scenario in which we are going to:

  • Load a progress bar
  • Start a file download using a button
  • Update the progress bar during the download
  • Start the video player after the download is completed

Our user interface will be very simple. We will just need a fancy progress bar and a DOWNLOAD button.

Executing a network task

First of all, we will create mDownloadProgress:

private PublishSubject<Integer>mDownloadProgress = PublishSubject.create(); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required