Created
August 30, 2015 22:44
-
-
Save oznus/929f4fb69a7e87e5c212 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//Create all Retrofit stuff.. | |
RestAdapter restAdapter = new RestAdapter.Builder() | |
.setEndpoint("https://api.myserver.com") | |
.build(); | |
MyService service = restAdapter.create(MyService.class); | |
//Fetch the user from the api | |
User user = service.getUser("432947"); | |
//Save it to realm | |
Realm realm = Realm.getInstance(context; | |
realm.beginTransaction(); | |
realm.copyToRealm(user); | |
realm.commitTransaction(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment