Skip to content

Instantly share code, notes, and snippets.

View kalyandechiraju's full-sized avatar
🎯
Focusing

Kalyan Dechiraju kalyandechiraju

🎯
Focusing
View GitHub Profile
@kalyandechiraju
kalyandechiraju / README.md
Created October 11, 2015 17:10 — forked from zenorocha/README.md
A template for Github READMEs (Markdown) + Sublime Snippet

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

package com.mindstorm.famousquotesandroid;
import android.accounts.AccountManager;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>
@kalyandechiraju
kalyandechiraju / Password.java
Created May 21, 2016 15:00 — forked from craSH/Password.java
A simple example Java class to safely generate and verify bcrypt password hashes for use in authentication systems.
/**
* Author: Ian Gallagher <igallagher@securityinnovation.com>
*
* This code utilizes jBCrypt, which you need installed to use.
* jBCrypt: http://www.mindrot.org/projects/jBCrypt/
*/
public class Password {
// Define the BCrypt workload to use when generating password hashes. 10-31 is a valid value.
private static int workload = 12;
public class AppengineFirebaseAuth {
private static final String APP_ID = "YOUR_APP_ID";
public static AppengineFirebaseToken verifyIdToken(String token) {
Map<String, String> publicKeys = GooglePublicKeys.getKeys();
for (String kid : publicKeys.keySet()) {
String publicKey = publicKeys.get(kid);
@kalyandechiraju
kalyandechiraju / AndroidTip.txt
Created October 22, 2016 11:12 — forked from johnkil/AndroidTip.txt
30 helpful Android development Tips/Tricks
1) ListView=>Use android:cacheColorHint=”@android:color/transparent” to avoid black highlighting while Scrolling.
2) To resolve this issue “Failed to install *.apk on device timeout Launch canceled! , increase ADB connection timeout
3) use setError() to display error message for your EditText
4) To Block the default animation for startActivity() For ex: myIntent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
5) Android Action Bar Style Generator http://jgilfelt.github.com/android-actionbarstylegenerator
6) create library with reusable code and reference it in future projects.
7) Don’t use right-pointing carets on line items http://developer.android.com/design/media/migrating_ios_settings.png
8) 10 amazing Android development tips http://www.netmagazine.com/features/10-amazing-android-development-tips
9) Define these attributes for displaying multiline EditText => android:singleLine=”false”, android:lines=”5″
10) Follow Dashboard design pattern. Easy to implement and handle Navigation.
@kalyandechiraju
kalyandechiraju / post.md
Created December 24, 2016 19:29 — forked from grantland/post.md
RecyclerView item onClick

RecyclerView item onClick

RecyclerView does not have an OnItemClickListener like it's predecessor, ListView. However, detecting item clicks is pretty simple.

Set an OnClickListener in your ViewHolder creation:

private class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder>  {

    public static class ViewHolder extends RecyclerView.ViewHolder
@kalyandechiraju
kalyandechiraju / AndroidManifest.xml
Created January 14, 2017 10:54 — forked from BrandonSmith/AndroidManifest.xml
Quick example of how to schedule a notification in the future using AlarmManager
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cards.notification">
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
@kalyandechiraju
kalyandechiraju / CheatSheet.java
Created February 19, 2017 07:26 — forked from romannurik/CheatSheet.java
Android helper class for showing cheat sheets (tooltips) for icon-only UI elements on long-press. This is already default platform behavior for icon-only action bar items and tabs. This class provides this behavior for any other such UI element.
/*
* Copyright 2012 Google 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
@kalyandechiraju
kalyandechiraju / 0_reuse_code.js
Created August 15, 2017 07:28
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console