Invokes main(String[]) method on class in args[0] with args[1..n].
if (args.length == 0) {
printUsage();
return;
}
Class<?> mainClass = Class.forName(args[0]);
System.loadLibrary("android_runtime");
if (registerNatives() < 0) {
throw new RuntimeException("Error registering natives.");
}
String[] newArgs = new String[args.length - 1];
System.arraycopy(args, 1, newArgs, 0, newArgs.length);
Method mainMethod = mainClass.getMethod("main", String[].class);
mainMethod.invoke(null, new Object[] { newArgs });