Skip to content

Instantly share code, notes, and snippets.

View mistrydarshan99's full-sized avatar

Darshan Mistry mistrydarshan99

View GitHub Profile
@mistrydarshan99
mistrydarshan99 / TestAlert.java
Last active August 28, 2015 10:50 — forked from vaibhav-jani/TestAlert.java
Test Alert and mail sender
import java.io.IOException;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
@mistrydarshan99
mistrydarshan99 / OverFlowMenu.java
Last active August 29, 2015 14:27
Customize overflow menu
<!-- APP Theme which extends Theme App Compact -->
<style name="CustomActionBarTheme" parent="@style/Theme.AppCompat">
<item name="android:actionOverflowButtonStyle">@style/OverflowButton</item>
<item name="actionOverflowButtonStyle">@style/OverflowButton</item>
<item name="android:dropDownListViewStyle">@style/PopupMenuListView</item>
<item name="dropDownListViewStyle">@style/PopupMenuListView</item>
<item name="actionBarDivider">@null</item>
@mistrydarshan99
mistrydarshan99 / style.java
Created August 19, 2015 08:43
Style of Project
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="AppTheme.Base">
<!-- Customize your theme here. -->
</style>
<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
@mistrydarshan99
mistrydarshan99 / README.md
Last active August 29, 2015 14:26 — forked from gabrielemariotti/README.md
How to manage the support libraries in a multi-module projects. Thanks to Fernando Cejas (http://fernandocejas.com/)

Centralize the support libraries dependencies in gradle

Working with multi-modules project, it is very useful to centralize the dependencies, especially the support libraries.

A very good way is to separate gradle build files, defining something like:

root
  --gradleScript
 ----dependencies.gradle
public class ColoredSnackBar {
private static final int red = 0xfff44336;
private static final int green = 0xff4caf50;
private static final int blue = 0xff2195f3;
private static final int orange = 0xffffc107;
private static View getSnackBarLayout(Snackbar snackbar) {
if (snackbar != null) {
@mistrydarshan99
mistrydarshan99 / database
Created June 23, 2015 09:52
Android get Database file from internal device memory
/*** Dababase device ma thi bahar kadhva *****/
http://stackoverflow.com/questions/19194576/how-to-view-the-sqlite-database-in-device-android
1.)View Database filename :
=============================
adb -d shell "run-as com.yourpackge.name ls /data/data/com.yourpackge.name/databases/"
2.)Copy Database file to SDCard :
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 The Android Open Source Project
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
@mistrydarshan99
mistrydarshan99 / Makeup
Last active August 29, 2015 14:16 — forked from Trikke/Makeup
package trikke.gists;
import android.graphics.Typeface;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.BackgroundColorSpan;
import android.text.style.ForegroundColorSpan;
import android.text.style.RelativeSizeSpan;
import android.text.style.StrikethroughSpan;
import android.text.style.StyleSpan;

#GDG Android in Berlin brainstorming session


On November 27, 2013 I was asking the brilliant Android developers at GDG Android in Berlin for their favorite libraries that make their lives easier and should be included in every newly developed app.

This is the list of libraries we collected during this 10 minute session.

Architecture

@mistrydarshan99
mistrydarshan99 / gist:4bdfdeb4cb8f6cadb772
Created August 28, 2014 03:43
Http Get and Http Post class
package Backend;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.List;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;