Skip to content

Instantly share code, notes, and snippets.


Halyson Lima Gonçalves halysongoncalves

View GitHub Profile
felipecsl /
Last active Jan 28, 2019
Helper class to parse error response body on Retrofit 2
public static class ExceptionParser {
private final ResponseBody body;
private final String bodyString;
private final Converter.Factory converterFactory;
public ExceptionParser(Response response, Converter.Factory converterFactory) {
this.converterFactory = converterFactory;
this.body = cloneResponseBody(response.errorBody());
this.bodyString = getBodyAsString(body);
ZakTaccardi / build.gradle
Created Aug 26, 2015
Automatic per-variant google_services.json configurations with Gradle
View build.gradle
//append code below to existing build.gradle
def appModuleRootFolder = '.'
def srcDir = 'src'
def googleServicesJson = 'google-services.json'
task switchToDebug(type: Copy) {
def buildType = 'debug'
description = 'Switches to DEBUG google-services.json'
from "${srcDir}/${buildType}"