String result = YourClass.someMethod(); TextView tv = findViewById(R.id.textView); tv.setText(result);

If you have a headless JAR, wrapping it into an APK is straightforward. If it has a desktop GUI, you’re better off rewriting the UI for Android.

In MainActivity.java :

System.out.flush(); String output = baos.toString(); runOnUiThread(() -> textView.setText(output)); }).start(); That’s not conversion — that’s rewriting or recompiling.