Skip to content

Instantly share code, notes, and snippets.

@Gilinho
Gilinho / permissions.txt
Created October 10, 2016 08:04 — forked from Arinerron/permissions.txt
A list of all Android permissions...
android.permission.ACCESS_ALL_DOWNLOADS
android.permission.ACCESS_BLUETOOTH_SHARE
android.permission.ACCESS_CACHE_FILESYSTEM
android.permission.ACCESS_CHECKIN_PROPERTIES
android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY
android.permission.ACCESS_DOWNLOAD_MANAGER
android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED
android.permission.ACCESS_DRM_CERTIFICATES
android.permission.ACCESS_EPHEMERAL_APPS
android.permission.ACCESS_FM_RADIO
@Gilinho
Gilinho / GoogleSignInBaseActivity.java
Created November 27, 2015 10:19
Extend this class to implement google sign-in. Call googleSignIn(), googleSignout() and googleRevokeAccess() as per your needs, and @OverRide handleGoogleSignInResult. setSilentSignIn(false) to stop silent sign in http://bit.ly/1kVJAHZ.
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import com.google.android.gms.auth.api.Auth;
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
import com.google.android.gms.auth.api.signin.GoogleSignInResult;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
@Gilinho
Gilinho / gist:65a40265b550ea9130e0
Created October 11, 2015 19:13 — forked from JakeWharton/gist:f50f3b4d87e57d8e96e9
Rise and Shine™, unlock and wake up your device automatically when you deploy from the IDE. Put this somewhere in your `src/debug/` code and run it when the application or main activity starts. Apache 2.
/**
* Show the activity over the lockscreen and wake up the device. If you launched the app manually
* both of these conditions are already true. If you deployed from the IDE, however, this will
* save you from hundreds of power button presses and pattern swiping per day!
*/
public static void riseAndShine(Activity activity) {
activity.getWindow().addFlags(FLAG_SHOW_WHEN_LOCKED);
PowerManager power = (PowerManager) activity.getSystemService(POWER_SERVICE);
PowerManager.WakeLock lock =
@Gilinho
Gilinho / build.gradle
Last active August 26, 2015 21:47 — forked from chanakin/build.gradle
Gradle Build file that creates different "apps" based on the build type, letting you load apps side-by-side (beta vs. production)
apply plugin: 'com.android.application'
def final yourApplicationId = 'com.yourId.android'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
sourceSets {
androidTest {
java.srcDirs = ['test/java']
}
}
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Social media and other company colors -->
<eat-comment />
<color name="facebook">#FF3B5998</color>
<color name="twitter">#FF00ACED</color>
<color name="google_plus">#FFDD4B39</color>
<color name="youtube">#FFBB0000</color>
/*
* Copyright (C) 2014 Jared Rummler <jared@jrummyapps.com>, Vincent Mimoun-Prat, Dmitriy Tarasov
*
* 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 distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
@Gilinho
Gilinho / colors.xml
Last active August 29, 2015 14:13 — forked from jaredrummler/colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Social media and other company colors -->
<eat-comment />
<color name="facebook">#FF3B5998</color>
<color name="twitter">#FF00ACED</color>
<color name="google_plus">#FFDD4B39</color>
<color name="youtube">#FFBB0000</color>