title: When should one use RxJava Observable and when simple Callback on Android?
body: <p>I'm working on networking for my app. So I decided to try out Square's <a href="https://github.com/square/retrofit" rel="noreferrer">Retrofit</a>. I see that they support simple <code>Callback</code></p>
  <pre><code>@GET(&quot;/user/{id}/photo&quot;)
  void getUserPhoto(@Path(&quot;id&quot;) int id, Callback&lt;Photo&gt; cb);
  </code></pre>
  <p>and RxJava's <code>Observable</code></p>
  <pre><code>@GET(&quot;/user/{id}/photo&quot;)
  Observable&lt;Photo&gt; getUserPhoto(@Path(&quot;id&quot;) int id);
  </code></pre>
  <p>Both look pretty similar at first glance, but when it gets to implementation it gets interesting...</p>
  <p>While with simple callback implementation would look similar to this:</p>
  <pre><code>api.getUserPhoto(photoId, new Callback&lt;Photo&gt;() {
      @Override
      public void onSuccess() {
      }
  });
  </code></pre>
  <p>which is quite simple and straightforward. And with <code>Observable</code> it quickly gets verbose and quite complicated.</p>
  <pre><code>public Observable&lt;Photo&gt; getUserPhoto(final int photoId) {
      return Observable.create(new Observable.OnSubscribeFunc&lt;Photo&gt;() {
          @Override
          public Subscription onSubscribe(Observer&lt;? super Photo&gt; observer) {
              try {
                  observer.onNext(api.getUserPhoto(photoId));
                  observer.onCompleted();
              } catch (Exception e) {
                  observer.onError(e);
              }
  
              return Subscriptions.empty();
          }
      }).subscribeOn(Schedulers.threadPoolForIO());
  }
  </code></pre>
  <p>And that is not it. You still have to do something like this:</p>
  <pre><code>Observable.from(photoIdArray)
          .mapMany(new Func1&lt;String, Observable&lt;Photo&gt;&gt;() {
              @Override
              public Observable&lt;Photo&gt; call(Integer s) {
                  return getUserPhoto(s);
              }
          })
          .subscribeOn(Schedulers.threadPoolForIO())
          .observeOn(AndroidSchedulers.mainThread())
          .subscribe(new Action1&lt;Photo&gt;() {
              @Override
              public void call(Photo photo) {
                  //save photo?
              }
          });
  </code></pre>
  <p>Am I missing something here? Or is this a wrong case to use <code>Observable</code>s?
  When would/should one prefer <code>Observable</code> over simple Callback?</p>
  <h2>Update</h2>
  <p>Using retrofit is much simpler than example above as @Niels showed in his answer or in Jake Wharton's example project <a href="https://github.com/JakeWharton/u2020" rel="noreferrer">U2020</a>. But essentially the question stays the same - when should one use one way or the other?</p>