Created
February 25, 2014 07:42
-
-
Save twocity/9204580 to your computer and use it in GitHub Desktop.
usage of ricebook api client
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
package com.ricebook.app.api; | |
import com.ricebook.app.api.utils.OkClientFactory; | |
import com.ricebook.app.api.utils.RestAdapterFactory; | |
import android.app.Application; | |
import retrofit.RestAdapter; | |
/** | |
* Usage of ricebook api client | |
*/ | |
public class ApiApplication extends Application { | |
private RestAdapter mRestAdapter; | |
private RicebookApiClient mApiClient; | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
initApiClient(); | |
} | |
public void initApiClient() { | |
mRestAdapter = RestAdapterFactory.make(new UserManager(), OkClientFactory.make(this)); | |
mApiClient = new RicebookApiClient(mRestAdapter); | |
} | |
public RicebookApiClient getApiClient() { | |
return this.mApiClient; | |
} | |
public RestAdapter getRestAdapter() { | |
return mRestAdapter; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment