Skip to content

Instantly share code, notes, and snippets.

HtmlImageGetter imageGetter = new HtmlImageGetter(getActivity(), R.drawable.image_html_response_background) {
@Override
public void onTextUpdate() {
CharSequence sequence = textView.getText();
textView.setText(sequence);
}
};
Spanned spanned;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
{
"Faces": [
{
"name": "Oh well!",
"art" : "¯\\_(ツ)_/¯"
},
{
"name": "Disapproving Look",
"art": "ಠ_ಠ"
},
@Kishanjvaghela
Kishanjvaghela / TLSSocketFactory.java
Last active November 20, 2018 12:14 — 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;
@alvinthen
alvinthen / opacity.txt
Created July 29, 2016 17:20
Convert opacity values in percentage to hexadecimal
0% - 00
1% - 03
2% - 05
3% - 08
4% - 0A
5% - 0D
6% - 0F
7% - 12
8% - 14
9% - 17
dependencies {
compile 'com.kbeanie:image-chooser-library:1.4.4@aar'
compile 'com.soundcloud.android:android-crop:1.0.1@aar'
}
@Kishanjvaghela
Kishanjvaghela / Utils.java
Created February 26, 2016 11:03
Utility methods
/**
* get android id of device.
*
* @param context app context
* @return android id
*/
public static String getAndroidID(Context context) {
if (context != null) {
return Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
} else {
@Kishanjvaghela
Kishanjvaghela / prog.c
Created February 11, 2016 07:24
Program to print number 1..n as right triangle.
#include <stdio.h>
int main(void) {
int i,j,rows;
printf("Enter the nth number of series: ");
scanf("%d",&rows);
printf("\n");
for(i=1;i<=rows;++i)
{
for(j=1;j<=i;++j)
@maheshwarLigade
maheshwarLigade / build.gradle
Created February 2, 2016 05:25 — forked from jackgris/build.gradle
Example of use from Proguard, from Android Studio
buildscript {
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
classpath 'com.squareup.gradle:gradle-android-test-plugin:0.9.1-SNAPSHOT'
@jgilfelt
jgilfelt / CurlLoggingInterceptor.java
Created January 9, 2016 15:34
An OkHttp interceptor that logs requests as curl shell commands
/*
* Copyright (C) 2016 Jeff Gilfelt.
*
* 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