import javax.imageio.*; import java.awt.image.*; import java.awt.event.*; import java.awt.*; import java.security.NoSuchAlgorithmException; import java.security.MessageDigest; import java.lang.management.*; import java.lang.reflect.*; import java.net.*; import java.io.*; import javax.swing.text.*; import javax.swing.event.*; import javax.swing.*; import java.util.concurrent.atomic.*; import java.util.concurrent.*; import java.util.regex.*; import java.util.List; import java.util.zip.*; import java.util.*; import android.app.Activity; import android.widget.*; import android.graphics.*; public class main { static Activity androidContext; public static void main(String[] args) throws Exception { System.out.println("Hello world!"); System.out.println("androidContext = " + androidContext); ImageView iv = new ImageView(androidContext); int w=256, h=256; int[] pixels = new int[w*h]; for (int i=0; i < w*h; i++) pixels[i] = i; Bitmap bitmap = Bitmap.createBitmap(pixels, w, h, Bitmap.Config.RGB_565); iv.setImageBitmap(bitmap); final ScrollView sv = new ScrollView(androidContext); sv.addView(iv); androidContext.runOnUiThread(new Runnable() { public void run() { androidContext.setContentView(sv); } }); System.out.println("yo"); } }