Skip to content

Instantly share code, notes, and snippets.

@JakeWharton
JakeWharton / gist:f50f3b4d87e57d8e96e9
Created February 7, 2015 01:59
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 =
@rcgroot
rcgroot / OAuthStack.java
Last active November 11, 2015 23:55
OAuth 1.0a with Signport on Volley including support for multiple operations and volleys multithreading
/*
** ------------------------------------------------------------------------------
** 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
** ------------------------------------------------------------------------------
*/
package nl.sogeti.android.deviceprofiler.network;
import android.support.v4.util.LongSparseArray;