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
// Top-level build file where you can add configuration options common to all sub-projects/modules. | |
buildscript { | |
apply from: '../versions.gradle' | |
addRepos(repositories) | |
allprojects { repositories { maven { url 'https://jitpack.io' } } } | |
dependencies { | |
classpath deps.android_gradle_plugin | |
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
dependencies { | |
// Support libraries | |
implementation deps.constraint_layout | |
implementation deps.support.app_compat | |
compile deps.support.app_compat | |
compile deps.support.v4 | |
compile deps.support.design | |
// Architecture components | |
compile deps.lifecycle.runtime |
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.perusudroid.sampleretro; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.Button; | |
import com.perusudroid.rxretro.IResponseListener; | |
import com.perusudroid.rxretro.RXRetro; | |
import com.perusudroid.sampleretro.dto.request.PostInput; | |
import com.perusudroid.sampleretro.dto.response.get.GetSample; |
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
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 26 | |
defaultConfig { | |
applicationId "com.perusudroid.sampleretro" | |
minSdkVersion 15 | |
targetSdkVersion 26 | |
versionCode 1 | |
versionName "1.0" |
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.perusudroid.rxretro; | |
/** | |
* Created by perusu on 13/12/17. | |
*/ | |
public class Constants { | |
interface httpcodes{ | |
int STATUS_OK = 200; |
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
apply plugin: 'com.android.library' | |
android { | |
compileSdkVersion 26 | |
defaultConfig { | |
minSdkVersion 15 | |
targetSdkVersion 26 |
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.perusudroid.rxretro; | |
import android.util.Log; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import okhttp3.ResponseBody; |
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
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 26 | |
defaultConfig { | |
applicationId "com.perusudroid.sampleretro" | |
minSdkVersion 15 | |
targetSdkVersion 26 | |
versionCode 1 | |
versionName "1.0" |
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
@Override | |
public void onNext(Response<ResponseBody> paramResponse) { | |
Log.d(TAG, "RESPONSE CODE - " + paramResponse.raw().code()); | |
Log.d(TAG, "RAW RESPONSE - " + paramResponse.raw()); | |
Object localObject = paramResponse.body(); | |
String str = null; | |
if (localObject != null) { | |
str = getStringFromByte(getByteStream(paramResponse.body())); |