Skip to content

Instantly share code, notes, and snippets.

html, body {
margin:0;
padding:0;
height:100%;
}
html {
background:-webkit-linear-gradient(left, #000, #fff);
background: -moz-linear-gradient(left, #000, #fff);
background: -o-linear-gradient(left, #000, #fff);
@comoc
comoc / AndroidLaunchExternalActivity.java
Last active August 31, 2024 08:02
Launch an external activity with its package and class name. For example, the package name is "com.example.hello", and the class name is "com.example.hello.MainActivity".
/**
* Launch an activity.
* @param context The context to use. Usually your Application or Activity object.
* @param packageName The name of the package that the component exists in. Can not be null.
* @param className The name of the class inside of pkg that implements the component. Can not be null.
* @see {ANDROID_SDK}/samples/android-{VERSION}/Home/src/com/example/android/home/Home.java
*/
private void launch(Context context, String packageName, String className) {
if (context == null || packageName == null || className == null)
return;
@comoc
comoc / FullscreenExample.pde
Created August 14, 2013 05:52
An example of fullscreen sketch under multi-screen environment for Processing.
// Fullscreen sketch example under multi-screen environment
// @see http://processing.org/discourse/beta/num_1185318989.html
import java.awt.*;
static final int PREFERRED_GRAPHICS_DEVICE_INDEX = 1; //< This value represents the target monitor.
Rectangle monitorBounds = new Rectangle();
public void init() {
@comoc
comoc / AndroidApplicationListing.java
Last active January 4, 2020 16:27
How to list installed applications on Android.
//{ Locate follows into your class
public static class ApplicationInfo {
public String label;
public String name;
public String packageName;
public Drawable icon;
@Override
public String toString() {
return "label:" + label + " name:" + name + " packageName:"