!7 import android.app.Activity; import android.widget.*; import android.graphics.*; import android.content.*; // Intent etc. p { int frames = 100; print("Putting " + frames + " frames on widget... Switching to home screen so you can see it!"); // go to home screen Intent startMain = new Intent(Intent.ACTION_MAIN); startMain.addCategory(Intent.CATEGORY_HOME); startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); call(androidContext, "startActivity", startMain); for f to frames: { int shift=new java.util.Random().nextInt(); int w=256, h=256; int[] pixels = new int[w*h]; for (int i=0; i < w*h; i++) pixels[i] = i+shift; Bitmap bitmap = Bitmap.createBitmap(pixels, w, h, Bitmap.Config.RGB_565); call(androidContext(), "updateWidgetWithBitmap", bitmap); } print("yo"); }