Skip to content

Instantly share code, notes, and snippets.

View coffeearmy's full-sized avatar
Coffee hunter

ElisaDGM coffeearmy

Coffee hunter
View GitHub Profile
{"PKMIMG":{ "Bulbasaur":"http://img.pokemondb.net/artwork/bulbasaur.jpg","Ivysaur":"http://img.pokemondb.net/artwork/ivysaur.jpg","Venusaur":"http://img.pokemondb.net/artwork/venusaur.jpg","Charmander":"http://img.pokemondb.net/artwork/charmander.jpg","Charmeleon":"http://img.pokemondb.net/artwork/charmeleon.jpg","Charizard":"http://img.pokemondb.net/artwork/charizard.jpg","Squirtle":"http://img.pokemondb.net/artwork/squirtle.jpg","Wartortle":"http://img.pokemondb.net/artwork/wartortle.jpg","Blastoise":"http://img.pokemondb.net/artwork/blastoise.jpg","Caterpie":"http://img.pokemondb.net/artwork/caterpie.jpg","Metapod":"http://img.pokemondb.net/artwork/metapod.jpg","Butterfree":"http://img.pokemondb.net/artwork/butterfree.jpg","Weedle":"http://img.pokemondb.net/artwork/weedle.jpg","Kakuna":"http://img.pokemondb.net/artwork/kakuna.jpg","Beedrill":"http://img.pokemondb.net/artwork/beedrill.jpg","Pidgey":"http://img.pokemondb.net/artwork/pidgey.jpg","Pidgeotto":"http://img.pokemondb.net/artwork/pidgeotto.jpg","Pi
[
{
"id": "01",
"name": "Bulbasaur",
"species": "Seed Pokémon",
"type": [
"Grass",
"Poison"
],
"height": "2′4″ (0.71m)",
public class APIHandler {
private static final String API_URL = "http://api2.softonic.com";
private static RestAdapter restAdapter;
public APIHandler() {}
private static RestAdapter getRestAdapter(){
if(restAdapter==null){
restAdapter = new RestAdapter.Builder()
@coffeearmy
coffeearmy / APIHandler.java
Created May 18, 2014 21:26
Android Rest call with RetroFIT
package com.coffeearmy.softtest.rest;
import retrofit.RestAdapter;
public class APIHandler {
private static final String API_URL = "http://api2.softonic.com";
private static RestAdapter restAdapter;
public APIHandler() {}
@coffeearmy
coffeearmy / DialogHelper.java
Last active August 29, 2015 14:01
Dialogs in Android
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
public class DialogHelper {
public static void showDialog2Button(Context c, final String title,
final String message,
DialogInterface.OnClickListener positiveListener,
DialogInterface.OnClickListener negativeListener) {
@coffeearmy
coffeearmy / AndroidOTTOBusHelper
Last active August 29, 2015 14:01
OTTO in android
import com.squareup.otto.Bus;
public class OttoBusHelper {
private static Bus _currentBus;
public OttoBusHelper()
{
}
@coffeearmy
coffeearmy / EntityHandlerGreenDAO
Last active August 29, 2015 14:01
EntityHandler for Green Dao
package com.lucentia.ahorrarelec.data;
import java.util.List;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.Property;
import de.greenrobot.dao.query.WhereCondition;
@coffeearmy
coffeearmy / AndroidList
Last active August 29, 2015 14:01
Android List. with LoaderCallback, Adapter and OTTO events bus, ImageLoader
import java.util.ArrayList;
import java.util.List;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.app.LoaderManager.LoaderCallbacks;
import android.support.v4.content.Loader;
import android.view.LayoutInflater;
import android.view.Menu;
@coffeearmy
coffeearmy / AndroidNavigationDrawer
Created May 17, 2014 10:37
Android Navigation Drawer
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.widget.DrawerLayout;
@coffeearmy
coffeearmy / AndroidViewPagerExample
Last active August 29, 2015 14:01
Android ViewPager with ViewPagerIndicator lib
package com.lucentia.ahorrarelec;
import android.app.ActionBar;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import android.view.Menu;
import com.lucentia.ahorraelec.tabs.SectionsPagerAdapter;