!636 !standard functions // for "call" import android.app.Activity; import android.widget.*; import android.graphics.*; import android.content.*; // Intent etc. main { static Activity androidContext; psvm { int frames = 100; System.out.println("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 (int f = 0; f < frames; f++) { 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" } }