android - It's possible to download only one Json with retrofit2 for time? -
i'm using code download list of airports:
final retrofit retrofit = new retrofit.builder() .addconverterfactory(gsonconverterfactory.create()) .addcalladapterfactory(rxjavacalladapterfactory.create()) .baseurl(airportservice.service_endpoint).build(); airportservice service = retrofit.create(airportservice.class); service.getairport() .subscribeon(schedulers.newthread()) .observeon(androidschedulers.mainthread()) .subscribe(new subscriber<list<airport>>() { @override public void oncompleted() { } @override public void onerror(throwable e) { e.printstacktrace(); } @override public void onnext(list<airport> airports) { airps = airports; } });
with interface:
@get("airports.json") observable<list<airport>> getairport();
i want know if it's possible have in onnext() method airport , not list . i'll try i've got error (because airports 40k) , if it's possible add progress bar show download.
thank answers.
Comments
Post a Comment