Skip to content

Instantly share code, notes, and snippets.

View jonathanvm13's full-sized avatar
😀

Jonathan Vallejo Muñoz jonathanvm13

😀
View GitHub Profile
Preferencias para Atom
@jonathanvm13
jonathanvm13 / SupportVersion.java
Created April 8, 2016 16:09 — forked from Aracem/SupportVersion.java
Util class to check if the current API is as least certain API level.
package com.acdroid.util.version;
import android.os.Build;
/**
* Util class to check if the current device is running some of the awesome Android versions.
*
* Created by Marcos Trujillo (─‿‿─) on 3/02/14.
*/
public class SupportVersion {
@jonathanvm13
jonathanvm13 / retrofit-custom-error-handling.java
Created February 6, 2016 13:10 — forked from benvium/retrofit-custom-error-handling.java
Fairly simply Retrofit custom error handling example. Is set up so that you don't need to do much work in the 'failure' handler of a retrofit call to get the user-visible error message to show. Works on all endpoints. There's lots of exception handling as our server folks like to keep us on our toes by sending all kinds of random stuff..!
// on error the server sends JSON
/*
{ "error": { "data": { "message":"A thing went wrong" } } }
*/
// create model classes..
public class ErrorResponse {
Error error;