Jon-Yngve Bakke
Janishar Ali
1

Janishar Ali OK, then I guess we have to change the web server or find another way to submit it.

There was another thing I was wondering about too. I’m completely new to RX. What would be the correct way to insert a record into the database, then upload it to the server in a reactive chain?

Based on your MVP sample project, I have done this to create on web server, but how can I insert into local database first in the same operation?

getDataManager()
.doCreateItemApiCall(request, sessionId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ItemResponse.CreateItemResponse>() {
@Override
public void accept(ItemResponse.CreateItemResponse response) throws Exception {
// success processing

}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
// error handling
}
}));
Show your support

Clapping shows how much you appreciated Jon-Yngve Bakke’s story.