Skip to content

Instantly share code, notes, and snippets.

View rameshvoltella's full-sized avatar
😉
Will have small delay in response as am working on a main module @_work

Ramesh M Nair rameshvoltella

😉
Will have small delay in response as am working on a main module @_work
View GitHub Profile
@rameshvoltella
rameshvoltella / AccountUtils.java
Created August 28, 2017 06:12 — forked from imminent/AccountUtils.java
Utility to retrieve user profile on Android device
/**
* A collection of authentication and account connection utilities. With strong inspiration from the Google IO session
* app.
* @author Dandré Allison
*/
public class AccountUtils {
/**
* Interface for interacting with the result of {@link AccountUtils#getUserProfile}.
*/
@rameshvoltella
rameshvoltella / PhonecallReceiver.java
Created August 24, 2017 12:24 — forked from ftvs/PhonecallReceiver.java
Detecting an incoming call coming to an Android device. Remember to set the appropriate permissions in AndroidManifest.xml as suggested in the Stackoverflow link. Usage example in comments. Source: http://stackoverflow.com/a/15564021/264619 Explanation: http://gabesechansoftware.com/is-the-phone-ringing/#more-8
package com.gabesechan.android.reusable.receivers;
import java.util.Date;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
public abstract class PhonecallReceiver extends BroadcastReceiver {
@rameshvoltella
rameshvoltella / ic_password_visibility.xml
Created March 16, 2017 07:56 — forked from PareshMayani/ic_password_visibility.xml
Android Support library 24.2.0 - passwordToggleDrawable example
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zm0,-8c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z" />
</vector>
/*
* Copyright (C) 2008 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
@rameshvoltella
rameshvoltella / BitmapBitmapResourceDecoder.java
Created October 24, 2016 15:09 — forked from TWiStErRob/BitmapBitmapResourceDecoder.java
Glide 3.6.0 proof of concept for loading a Bitmap as Bitmap through Glide
class BitmapBitmapResourceDecoder implements ResourceDecoder<Bitmap, Bitmap> {
private final BitmapPool pool;
public BitmapBitmapResourceDecoder(Context context) {
this(Glide.get(context).getBitmapPool());
}
public BitmapBitmapResourceDecoder(BitmapPool pool) {
this.pool = pool;
}
@Override public Resource<Bitmap> decode(Bitmap source, int width, int height) throws IOException {
@rameshvoltella
rameshvoltella / DrawableBitmapResourceDecoder.java
Created October 24, 2016 15:09 — forked from TWiStErRob/DrawableBitmapResourceDecoder.java
Glide 3.6.0 proof of concept for loading a Drawable as Bitmap through Glide
class DrawableBitmapResourceDecoder implements ResourceDecoder<Drawable, Bitmap> {
private final BitmapPool pool;
public DrawableBitmapResourceDecoder(Context context) {
this(Glide.get(context).getBitmapPool());
}
public DrawableBitmapResourceDecoder(BitmapPool pool) {
this.pool = pool;
}
@Override public Resource<Bitmap> decode(Drawable drawable, int width, int height) throws IOException {
@rameshvoltella
rameshvoltella / ApiModule.java
Created October 8, 2016 09:44 — forked from billynyh/ApiModule.java
Android integration of retrofit, signpost, twitter api
public class ApiModule {
private TwitterApi mApi;
public void init(String token, String tokenSecret) {
OAuthConsumer consumer = new DefaultOAuthConsumer(
Config.TWEET_API_KEY,
Config.TWEET_API_SECRET);
consumer.setTokenWithSecret(token, tokenSecret);
@rameshvoltella
rameshvoltella / StatusBar
Created November 5, 2015 14:00 — forked from csdear/StatusBar
Notifications : StatusBar With CustomView
package course.examples.Notification.StatusBarWithCustomView;
import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnErrorListener;
import android.media.MediaPlayer.OnPreparedListener;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.webkit.WebChromeClient;
import android.widget.FrameLayout;
import android.widget.VideoView;
@rameshvoltella
rameshvoltella / GoogleMap NoClassDefFoundError
Created August 4, 2014 07:06
NoClassDefFoundError at Google Play Services V2 library
NoClassDefFoundError at Google Play Services V2 library i have answerd this in stackoverflow plz check the link below
http://stackoverflow.com/questions/13691028/noclassdeffounderror-at-google-play-services-v2-library/14686856#14686856