Skip to content

Instantly share code, notes, and snippets.

@f2prateek
f2prateek / README.md
Created May 19, 2013 01:43
Quickly deploy Volley to your maven repository.

Quickly deploy Volley to your maven repository. Volley is a library that makes networking for Android apps easier and most importantly, faster. For an example to use Volley in your app, check out Folly.

Steps

git clone https://android.googlesource.com/platform/frameworks/volley
cd volley
(download the pom.xml)
mvn clean install
@f2prateek
f2prateek / TLSSocketFactory.java
Last active July 17, 2019 22:09 — forked from fkrauthan/TLSSocketFactory.java
Custom SSLSocketFactory Implementation to enable tls 1.1 and tls 1.2 for android 4.1 (16+)
package net.cogindo.ssl;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import javax.net.ssl.SSLContext;
@f2prateek
f2prateek / CustomView.java
Last active June 11, 2018 02:57
Event Bus in view
public class CustomView extends View {
private final Bus bus;
public CustomView(Bus bus, ....) {
super(....);
this.bus = bus;
}
@Override protected void onAttachedToWindow() {
@f2prateek
f2prateek / ActivitySubscriptionManager.java
Last active October 23, 2017 14:30
Managing Subscriptions in Android with RxJava
/*
* Copyright 2014 Prateek Srivastava
*
* 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
package com.f2prateek.articuno.util;
import android.os.Bundle;
import android.os.IBinder;
import android.os.Parcelable;
import android.util.SparseArray;
import java.io.Serializable;
import java.util.ArrayList;
/**
@f2prateek
f2prateek / CheckBoxActionProvider.java
Created October 30, 2012 18:26
Custom Action Provider in ActionBar - a checkbox with a textview descrption
package com.psrivastava.deviceframegenerator.widget;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.TextView;
import android.widget.Toast;
@f2prateek
f2prateek / HttpRequestAdapter.java
Created June 4, 2014 05:44
Signing Requests with Retrofit and SignPost
package com.f2prateek.five00px.data.api.auth;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import oauth.signpost.http.HttpRequest;
import retrofit.client.Header;
import retrofit.client.Request;

Keybase proof

I hereby claim:

  • I am f2prateek on github.
  • I am f2prateek (https://keybase.io/f2prateek) on keybase.
  • I have a public key whose fingerprint is 39D2 2AF2 9FEA AE17 31BD 0B29 6D58 B458 1842 C429

To claim this, I am signing this object:

@f2prateek
f2prateek / gist:6416614
Created September 2, 2013 19:43
GradientColorHelper
/*
* Copyright 2013 Prateek Srivastava (@f2prateek)
*
* 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
@f2prateek
f2prateek / FluentSpannableStringBuilder.java
Last active December 21, 2015 03:49
FluentSpannableStringBuilder
package com.f2prateek.couchpotato.util;
import android.text.Spannable;
import android.text.SpannableString;
import java.util.ArrayList;
import java.util.List;
public class FluentSpannableStringBuilder {
List<Bean> beanList;