Skip to content

Instantly share code, notes, and snippets.

View LOG-TAG's full-sized avatar

Subrahmanya S M LOG-TAG

View GitHub Profile
@Antarix
Antarix / SDImageLoader.java
Last active November 24, 2016 09:54
This Class help you to load Image from SDcard to your listview Asynchronously
import java.lang.ref.WeakReference;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.widget.ImageView;
/*
@svangsgaard
svangsgaard / VolleyHelper.java
Last active April 22, 2022 01:53
A helper class to Google volley. Made with inspiration from AFNetworking. Usage: volley = new VolleyHelper(this, "<BASEURL>"/*Maybe get url from getString*/); volley.post("<service_name>", null, new Listener<JSONObject>() { @OverRide public void onResponse(JSONObject response) { Log.i("Got JSON", response.toString()); } }, new ErrorListener() { @…
import org.json.JSONObject;
import android.content.Context;
import com.android.volley.Request.Method;
import com.android.volley.RequestQueue;
import com.android.volley.Response.ErrorListener;
import com.android.volley.Response.Listener;
import com.android.volley.toolbox.ImageLoader;
@svangsgaard
svangsgaard / BitmapLruCache.java
Created June 26, 2013 09:23
A very simple BitmapCache - a wrapper around LruCache<String, Bitmap>. Can be used with volley.
import android.graphics.Bitmap;
import android.support.v4.util.LruCache;
import com.android.volley.toolbox.ImageLoader.ImageCache;
public class BitmapLruCache extends LruCache<String, Bitmap> implements ImageCache {
public static int getDefaultLruCacheSize() {
final int maxMemory = (int) (Runtime.getRuntime().maxMemory() / 1024);
final int cacheSize = maxMemory / 8;
@swankjesse
swankjesse / RetrofitCachingExample.java
Created June 29, 2013 03:03
Demonstrate HTTP caching with OkHttp and Retrofit.
/*
* Copyright (C) 2013 Square, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@myaaaaa-chan
myaaaaa-chan / GsonRequest
Created July 4, 2013 05:28
Volley adapter for JSON requests with POST method that will be parsed into Java objects by Gson @see https://gist.github.com/ficusk/5474673
package jp.i_dig.community.util;
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Request;
import com.android.volley.Response;
@amlcurran
amlcurran / LoadHideHelper.java
Last active December 19, 2015 20:09
Utility class which makes it easy to hide and show areas of the UI until the data they represent is loaded. Simply initialise with a Fragment or view(s), and call show() to show, and hide() to hide the UI. You can automatically add a ProgressBar* which will show and hide exactly when you need it to, and even supply your own custom animations by …
/*
* Copyright (c) 2013 Alex Curran
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@eveliotc
eveliotc / RoundedAvatarDrawable.java
Created July 22, 2013 04:59
RoundedAvatarDrawable: A Drawable that draws an oval with given {@link Bitmap} See http://evel.io/2013/07/21/rounded-avatars-in-android/
/*
* Copyright 2013 Evelio Tarazona Cáceres <evelio@evelio.info>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@tato469
tato469 / gist:6061397
Created July 23, 2013 10:24
How to generate automatic UML in your Android project + eclipse with javadoc
How to generate UML in your Android project + eclipse with javadoc:
First download apiviz from: https://code.google.com/p/apiviz/
0. extract the zip, for example in y case I did: C:\Program Files\Java\apiviz-1.3.2.GA
1. Project -> Generate JavaDocRight-click on a Java project.
2. Choose the 'Use custom doclet' radio button.
Enter 'org.jboss.apiviz.APIviz' in the 'Doclet name' field.
In 'Doclet class path' field set the location of the jar. C:\Program Files\Java\apiviz-1.3.2.GA\jar\apiviz-1.3.2.GA.jar
3. Click the 'Next' button. (Do not click the 'Finish' button yet.)
@jasonrudolph
jasonrudolph / 00-about-search-api-examples.md
Last active June 25, 2025 15:36
5 entertaining things you can find with the GitHub Search API
@ErikHellman
ErikHellman / PaintView.java
Created July 24, 2013 09:56
A very simple example of using multi-touch on Android to build a custom View for finger painting. This example uses the Path class from the android.graphics package. Feel free to use this code as you wish for your own multi-touch apps.
public class PaintView extends View {
public static final int MAX_FINGERS = 5;
private Path[] mFingerPaths = new Path[MAX_FINGERS];
private Paint mFingerPaint;
private ArrayList<Path> mCompletedPaths;
private RectF mPathBounds = new RectF();
public PaintView(Context context) {
super(context);
}