Wakey Droid allows you to wake your Android device from your computer over USB with the command adb shell am start -a android.intent.action.MAIN -n bdjnk.android.wakeydroid/.Wakey.
It is incredibly simple and works great (for me at least) but I'm sure it could be made better. The entire code is right below. If you've any suggestions, let me know. (hehe, it rhymes).
Wakey.java
AndroidManifest.xml
It is incredibly simple and works great (for me at least) but I'm sure it could be made better. The entire code is right below. If you've any suggestions, let me know. (hehe, it rhymes).
Wakey.java
Code:
package bdjnk.android.wakeydroid;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.os.PowerManager;
public class Wakey extends Activity {
private static PowerManager.WakeLock wakeLock;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
PowerManager pm = (PowerManager) getApplicationContext().getSystemService(Context.POWER_SERVICE);
wakeLock = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.ON_AFTER_RELEASE,"okTag");
wakeLock.acquire();
wakeLock.release();
Wakey.this.finish();
}
}
AndroidManifest.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="bdjnk.android.wakeydroid"
android:versionCode="2"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="4" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Wakey"
android:label="@string/app_name"
android:launchMode="singleInstance"
android:finishOnTaskLaunch="true"
android:noHistory="true"
android:stateNotNeeded="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.MONKEY" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.WAKE_LOCK" />
</manifest>
Last edited: