String result = YourClass.someMethod(); TextView tv = findViewById(R.id.textView); tv.setText(result);
// In your Activity new Thread(() -> { PrintStream originalOut = System.out; ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(baos); System.setOut(ps); YourJarMainClass.main(new String[]{}); how to convert jar file to apk for android
System.out.flush(); String output = baos.toString(); runOnUiThread(() -> textView.setText(output)); }).start(); That’s not conversion — that’s rewriting or recompiling. String result = YourClass