Starting Java Source File from Android Activity
<p>I wrote a program to work from the console in Eclipse and the terminal window in Linux. I am now transforming it into an Android app and I have the basic functionality of the Android UI done up until the point where it needs to use the logic from the Java file of the program I wrote. All of my inputs from the Java file are currently from the keyboard (from Scanners).</p>

<p>My question is: how do I transform this to get it work with the user interaction of the app? </p>

<p>The only input would be from the built in <code>NumberPicker</code>. The Java file starts from the main method: <code>public static void main(String[] args) {</code>)</p>

<p>For example:</p>

<p>Sample Android Code:</p>

<pre><code>public class Source1 extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.source1_layout);
        Intent intent = getIntent();
        int pickerValue = intent.getIntExtra("numEntered", 0);
}
</code></pre>

<p>Sample Java Code from program (Test.java):</p>

<pre><code>public class Test {

    public static void main(String[] args) {

    System.out.println("Enter number: ");
    Scanner reader = new Scanner(System.in);
    int num = reader.nextInt();
    ...
    }
}
</code></pre>

<p>How do I pass <code>pickerValue</code> into the main method of the <code>Test</code> class (starting the logic of the main method)? I want <code>num = pickerValue;</code> in the main method (replacing the <code>Scanner</code>). How is this done?</p>

<p>Also, will the print statements I have, <code>System.out.println(...);</code>, translate directly into the Android UI and print on the screen or do I have to modify those?</p>
