Created
August 23, 2017 14:34
-
-
Save aemxn/46faa94d6f9aff8e4035660af5dad1d2 to your computer and use it in GitHub Desktop.
API Manager
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.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