com.rx2androidnetworking.Rx2AndroidNetworking Java Examples

The following examples show how to use com.rx2androidnetworking.Rx2AndroidNetworking. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AppApiHelper.java    From android-mvp-interactor-architecture with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<LoginResponse> doFacebookLoginApiCall(LoginRequest.FacebookLoginRequest
                                                                request) {
    return Rx2AndroidNetworking.post(ApiEndPoint.ENDPOINT_FACEBOOK_LOGIN)
            .addHeaders(mApiHeader.getPublicApiHeader())
            .addBodyParameter(request)
            .build()
            .getObjectObservable(LoginResponse.class);
}
 
Example #2
Source File: NetworkingActivity.java    From RxJava2-Android-Samples with Apache License 2.0 5 votes vote down vote up
/**
 * flatMapWithZip Operator Example
 */

private Observable<List<User>> getUserListObservable() {
    return Rx2AndroidNetworking.get("https://fierce-cove-29863.herokuapp.com/getAllUsers/{pageNumber}")
            .addPathParameter("pageNumber", "0")
            .addQueryParameter("limit", "10")
            .build()
            .getObjectListObservable(User.class);
}
 
Example #3
Source File: NetworkingActivity.java    From RxJava2-Android-Samples with Apache License 2.0 5 votes vote down vote up
/**
 * flatMap and filter Operators Example
 */

private Observable<List<User>> getAllMyFriendsObservable() {
    return Rx2AndroidNetworking.get("https://fierce-cove-29863.herokuapp.com/getAllFriends/{userId}")
            .addPathParameter("userId", "1")
            .build()
            .getObjectListObservable(User.class);
}
 
Example #4
Source File: NetworkingActivity.java    From RxJava2-Android-Samples with Apache License 2.0 5 votes vote down vote up
/**
 * This observable return the list of User who loves cricket
 */
private Observable<List<User>> getCricketFansObservable() {
    return Rx2AndroidNetworking.get("https://fierce-cove-29863.herokuapp.com/getAllCricketFans")
            .build()
            .getObjectListObservable(User.class)
            .subscribeOn(Schedulers.io());
}
 
Example #5
Source File: AppApiHelper.java    From android-mvp-architecture with Apache License 2.0 5 votes vote down vote up
@Override
public Single<OpenSourceResponse> getOpenSourceApiCall() {
    return Rx2AndroidNetworking.get(ApiEndPoint.ENDPOINT_OPEN_SOURCE)
            .addHeaders(mApiHeader.getProtectedApiHeader())
            .build()
            .getObjectSingle(OpenSourceResponse.class);
}
 
Example #6
Source File: AppApiHelper.java    From android-mvp-architecture with Apache License 2.0 5 votes vote down vote up
@Override
public Single<BlogResponse> getBlogApiCall() {
    return Rx2AndroidNetworking.get(ApiEndPoint.ENDPOINT_BLOG)
            .addHeaders(mApiHeader.getProtectedApiHeader())
            .build()
            .getObjectSingle(BlogResponse.class);
}
 
Example #7
Source File: AppApiHelper.java    From android-mvp-architecture with Apache License 2.0 5 votes vote down vote up
@Override
public Single<LogoutResponse> doLogoutApiCall() {
    return Rx2AndroidNetworking.post(ApiEndPoint.ENDPOINT_LOGOUT)
            .addHeaders(mApiHeader.getProtectedApiHeader())
            .build()
            .getObjectSingle(LogoutResponse.class);
}
 
Example #8
Source File: AppApiHelper.java    From android-mvp-architecture with Apache License 2.0 5 votes vote down vote up
@Override
public Single<LoginResponse> doServerLoginApiCall(LoginRequest.ServerLoginRequest
                                                          request) {
    return Rx2AndroidNetworking.post(ApiEndPoint.ENDPOINT_SERVER_LOGIN)
            .addHeaders(mApiHeader.getPublicApiHeader())
            .addBodyParameter(request)
            .build()
            .getObjectSingle(LoginResponse.class);
}
 
Example #9
Source File: AppApiHelper.java    From android-mvp-architecture with Apache License 2.0 5 votes vote down vote up
@Override
public Single<LoginResponse> doFacebookLoginApiCall(LoginRequest.FacebookLoginRequest
                                                            request) {
    return Rx2AndroidNetworking.post(ApiEndPoint.ENDPOINT_FACEBOOK_LOGIN)
            .addHeaders(mApiHeader.getPublicApiHeader())
            .addBodyParameter(request)
            .build()
            .getObjectSingle(LoginResponse.class);
}
 
Example #10
Source File: AppApiHelper.java    From android-mvp-architecture with Apache License 2.0 5 votes vote down vote up
@Override
public Single<LoginResponse> doGoogleLoginApiCall(LoginRequest.GoogleLoginRequest
                                                          request) {
    return Rx2AndroidNetworking.post(ApiEndPoint.ENDPOINT_GOOGLE_LOGIN)
            .addHeaders(mApiHeader.getPublicApiHeader())
            .addBodyParameter(request)
            .build()
            .getObjectSingle(LoginResponse.class);
}
 
Example #11
Source File: AppApiHelper.java    From android-mvvm-architecture with Apache License 2.0 5 votes vote down vote up
@Override
public Single<OpenSourceResponse> getOpenSourceApiCall() {
    return Rx2AndroidNetworking.get(ApiEndPoint.ENDPOINT_OPEN_SOURCE)
            .addHeaders(mApiHeader.getProtectedApiHeader())
            .build()
            .getObjectSingle(OpenSourceResponse.class);
}
 
Example #12
Source File: AppApiHelper.java    From android-mvvm-architecture with Apache License 2.0 5 votes vote down vote up
@Override
public Single<BlogResponse> getBlogApiCall() {
    return Rx2AndroidNetworking.get(ApiEndPoint.ENDPOINT_BLOG)
            .addHeaders(mApiHeader.getProtectedApiHeader())
            .build()
            .getObjectSingle(BlogResponse.class);
}
 
Example #13
Source File: AppApiHelper.java    From android-mvvm-architecture with Apache License 2.0 5 votes vote down vote up
@Override
public Single<LoginResponse> doServerLoginApiCall(LoginRequest.ServerLoginRequest request) {
    return Rx2AndroidNetworking.post(ApiEndPoint.ENDPOINT_SERVER_LOGIN)
            .addHeaders(mApiHeader.getPublicApiHeader())
            .addBodyParameter(request)
            .build()
            .getObjectSingle(LoginResponse.class);
}
 
Example #14
Source File: AppApiHelper.java    From android-mvvm-architecture with Apache License 2.0 5 votes vote down vote up
@Override
public Single<LogoutResponse> doLogoutApiCall() {
    return Rx2AndroidNetworking.post(ApiEndPoint.ENDPOINT_LOGOUT)
            .addHeaders(mApiHeader.getProtectedApiHeader())
            .build()
            .getObjectSingle(LogoutResponse.class);
}
 
Example #15
Source File: AppApiHelper.java    From android-mvvm-architecture with Apache License 2.0 5 votes vote down vote up
@Override
public Single<LoginResponse> doGoogleLoginApiCall(LoginRequest.GoogleLoginRequest request) {
    return Rx2AndroidNetworking.post(ApiEndPoint.ENDPOINT_GOOGLE_LOGIN)
            .addHeaders(mApiHeader.getPublicApiHeader())
            .addBodyParameter(request)
            .build()
            .getObjectSingle(LoginResponse.class);
}
 
Example #16
Source File: AppApiHelper.java    From android-mvvm-architecture with Apache License 2.0 5 votes vote down vote up
@Override
public Single<LoginResponse> doFacebookLoginApiCall(LoginRequest.FacebookLoginRequest request) {
    return Rx2AndroidNetworking.post(ApiEndPoint.ENDPOINT_FACEBOOK_LOGIN)
            .addHeaders(mApiHeader.getPublicApiHeader())
            .addBodyParameter(request)
            .build()
            .getObjectSingle(LoginResponse.class);
}
 
Example #17
Source File: AppApiHelper.java    From android-mvp-interactor-architecture with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<OpenSourceResponse> getOpenSourceApiCall() {
    return Rx2AndroidNetworking.get(ApiEndPoint.ENDPOINT_OPEN_SOURCE)
            .addHeaders(mApiHeader.getProtectedApiHeader())
            .build()
            .getObjectObservable(OpenSourceResponse.class);
}
 
Example #18
Source File: AppApiHelper.java    From android-mvp-interactor-architecture with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<BlogResponse> getBlogApiCall() {
    return Rx2AndroidNetworking.get(ApiEndPoint.ENDPOINT_BLOG)
            .addHeaders(mApiHeader.getProtectedApiHeader())
            .build()
            .getObjectObservable(BlogResponse.class);
}
 
Example #19
Source File: AppApiHelper.java    From android-mvp-interactor-architecture with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<LogoutResponse> doLogoutApiCall() {
    return Rx2AndroidNetworking.post(ApiEndPoint.ENDPOINT_LOGOUT)
            .addHeaders(mApiHeader.getProtectedApiHeader())
            .build()
            .getObjectObservable(LogoutResponse.class);
}
 
Example #20
Source File: AppApiHelper.java    From android-mvp-interactor-architecture with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<LoginResponse> doServerLoginApiCall(LoginRequest.ServerLoginRequest
                                                              request) {
    return Rx2AndroidNetworking.post(ApiEndPoint.ENDPOINT_SERVER_LOGIN)
            .addHeaders(mApiHeader.getPublicApiHeader())
            .addBodyParameter(request)
            .build()
            .getObjectObservable(LoginResponse.class);
}
 
Example #21
Source File: AppApiHelper.java    From android-mvp-interactor-architecture with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<LoginResponse> doGoogleLoginApiCall(LoginRequest.GoogleLoginRequest
                                                              request) {
    return Rx2AndroidNetworking.post(ApiEndPoint.ENDPOINT_GOOGLE_LOGIN)
            .addHeaders(mApiHeader.getPublicApiHeader())
            .addBodyParameter(request)
            .build()
            .getObjectObservable(LoginResponse.class);
}
 
Example #22
Source File: NetworkingActivity.java    From RxJava2-Android-Samples with Apache License 2.0 4 votes vote down vote up
private Observable<List<User>> getFootballFansObservable() {
    return Rx2AndroidNetworking.get("https://fierce-cove-29863.herokuapp.com/getAllFootballFans")
            .build()
            .getObjectListObservable(User.class)
            .subscribeOn(Schedulers.io());
}
 
Example #23
Source File: NetworkingActivity.java    From RxJava2-Android-Samples with Apache License 2.0 4 votes vote down vote up
private Observable<UserDetail> getUserDetailObservable(long id) {
    return Rx2AndroidNetworking.get("https://fierce-cove-29863.herokuapp.com/getAnUserDetail/{userId}")
            .addPathParameter("userId", String.valueOf(id))
            .build()
            .getObjectObservable(UserDetail.class);
}