Question

How to run Solaris 11 or Cloud Solaris 11, Android Java? Or i can use the same Solaris 11 java. This is the script i was trying which works in Solaris 11 but not in Android.

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class HelloNonsenseDroid 
{
    private static String myInput = "no";

    public static void main(String[] args) throws IOException
    {  
      System.out.print("Q. Are you Xroid? Answer. ");

      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      myInput = br.readLine();

      if (myInput.equals("yes")) 
      {
        System.out.println("Yes! you are genius");
      } else {
        System.out.println("No! what in the earth, is No! try to learn to say \"Yes, we can\"");
      }

    }
}
Was it helpful?

Solution

You can't just run normal Java console apps on android. Android has it's own GUI system to show "windows" and other GUI elements. You need to use those to show content to users.

Start here: http://developer.android.com/guide/index.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top