Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@aemxn
Created August 23, 2017 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aemxn/46faa94d6f9aff8e4035660af5dad1d2 to your computer and use it in GitHub Desktop.
Save aemxn/46faa94d6f9aff8e4035660af5dad1d2 to your computer and use it in GitHub Desktop.
API Manager
package com.myapp.core.data.network;
public class APIManager {
private static APIManager sInstance;
private final AppAPI mApi;
public static APIManager getInstance() {
if (sInstance == null) {
sInstance = new APIManager();
}
return sInstance;
}
private APIManager() {
mApi = ServiceFactory.makeService();
}
/*<-------------Login----------> */
public void loginUser(Login login, RemoteCallback<LoginResponse> listener) {
mApi.loginUser(login).enqueue(listener);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment