Skip to content

Instantly share code, notes, and snippets.

View prasad091's full-sized avatar
🦊
Focusing

prasad prasad091

🦊
Focusing
  • Coimbatore
View GitHub Profile
@prasad091
prasad091 / AccessStorageApi
Created March 29, 2014 10:29
Access Storage In Android KITKAT
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import android.content.ContentUris;
import android.content.Context;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
@prasad091
prasad091 / TouchImageView
Created March 29, 2014 10:36
Touch Imageview Pinch Zoom In Android
import static com.ampro.android.customview.TouchImageView.State.ANIMATE_ZOOM;
import static com.ampro.android.customview.TouchImageView.State.DRAG;
import static com.ampro.android.customview.TouchImageView.State.FLING;
import static com.ampro.android.customview.TouchImageView.State.NONE;
import static com.ampro.android.customview.TouchImageView.State.ZOOM;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Matrix;
@prasad091
prasad091 / VideoControllerView
Created March 29, 2014 10:41
Custom Media Controller android
/*
* Copyright (C) 2006 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
*
* Unless required by applicable law or agreed to in writing, software
@prasad091
prasad091 / Utility.java
Created December 23, 2016 03:50
Utility Class
package com.kgislias.messenger.util;
import android.Manifest;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.pm.PackageManager;
import android.os.Build;
import android.support.v4.app.ActivityCompat;
@prasad091
prasad091 / AlertBuild.java
Last active January 3, 2017 06:49
Alert Dialog
package com.kgislias.messenger;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
/**
* Created by admin on 03-01-2017.
*/
public class AlertBuild extends AppCompatActivity{
@prasad091
prasad091 / ChatFontTextView.java
Last active January 3, 2017 07:14
Android Font
package com.yourpackage.util;
/**
The MIT License (MIT)
Copyright (c) 2015 Future Studio
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@prasad091
prasad091 / SearchActivity.java
Last active January 3, 2017 08:49
Search in Toolbar
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_search, menu);
MenuItem item = menu.findItem(R.id.action_search);
searchView.setMenuItem(item);
return true;
}
import java.util.ArrayList;
import java.util.List;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class DatabaseHandler extends SQLiteOpenHelper {
@prasad091
prasad091 / cardview.xml
Created January 6, 2017 05:04
CardView Xml
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/card_view"
android:layout_width="80dp"
android:layout_height="wrap_content"
card_view:cardUseCompatPadding="true"
card_view:cardCornerRadius="8dp"
android:layout_marginBottom="16dp">
@prasad091
prasad091 / build.gradle
Created January 6, 2017 05:21
Sample Gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
}
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'