Created
January 26, 2016 02:35
-
-
Save leeyc09/7214045875fc31021f76 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Call<JsonObject> jsonObjectCall = sample_RestfulAdapter.getInstance().Project(); | |
jsonObjectCall.enqueue(new Callback<JsonObject>() { | |
@Override | |
public void onResponse(Response<JsonObject> response) { | |
//통신성공 시 | |
JsonObject jsonObject = response.body(); | |
//Json 파싱 후 사용 | |
} | |
@Override | |
public void onFailure(Throwable t) { | |
//통신 실패 시 | |
} | |
}); | |
//use beans | |
Call<AuthModel> AuthObjectCall = sample_RestfulAdapter.getInstance().Auth(); | |
AuthObjectCall.enqueue(new Callback<AuthModel>() { | |
@Override | |
public void onResponse(Response<AuthModel> response) { | |
AuthModel authModel = response.body(); | |
authModel.getEmail(); | |
} | |
@Override | |
public void onFailure(Throwable t) { | |
} | |
}); | |
//use Rxandroid with Lambda | |
df_RestfulAdapter.getInstance().Project() | |
.subscribeOn(Schedulers.io()) | |
.observeOn(AndroidSchedulers.mainThread()) | |
.subscribe(jsonObject -> {}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment