Thursday, 15 August 2013

android - Pass parameters to chained responses with rxjava+retrofit -


I have a list of objects, which id, name and url and I URL image for each element the service need to call on that list, but I will add each object to the URL, something like

  public class PhotoDomainEntity {String id; String name; String url;}  

ID and name is known but I like this need to balance service call to get URL

  Observable.from (institutions) of KflatMap (new Funcl & LT; PhotoDomainEntity, direct & LT; PhotoEntity & gt; & gt; () {@Override publicly observable & LT; PhotoEntity & gt; call (PhotoDomainEntity s) {// call each ID photo Description return get PhotosApi.photosApi.getPhotoData (Constants.API_KEY, s. ID, Constants.FLICKR_FORMAT, Constants.NO_JSONP_RESPONSE);}})  

I PhotoDomainEntity for each call Programming is needed to add URLs. When does the response come for each call, how can I give ID and name?

overview PhotoDomainEntity, direct & lt; PhotoEntity & gt; & Gt; () {@Override Public Notifier & LT; PhotoEntity & gt; Phone (last PhotoDomainEntity s) {// return each ID for phone picture KflatMap (New Func1 get PhotosApikphotosApikgetPhotoData (entities) information & lt from (Constants.API_KEY, s.id, Constants.FLICKR_FORMAT, Constants. NO_JSONP_RESPONSE) .map (New Func1 & lt; PhotoEntity, PhotoEntity & gt; () {@Override Public PhotoEntity call (PhotoEntity fromServer) {// If: Variable: fromServer.setId (.getId ()); Separator;}}) ;}})

No comments:

Post a Comment