Hello Friends!
I am new to Android and I'm having problems. I have written a 15-game in java-code and now I'm about to implement it to an Android application.
I have written a method for printing out the state of the board to console in java with this:
public static void printBoard(Board board) {
for (int row = 0; row < 4; row++) {
for (int col = 0; col < 4; col++) {
if (board.getTile(row, col).getValue() == 0)
System.out.print(" ");
else
System.out.printf("%-3d",board.getTile(row,col)
.getValue());
}
System.out.println();
}
Now I have done the layout for the game and want to somehow write this method into a TextView. Problem is the System.out-print doens't work with android and the question is:
How can I write it into the TextView i've created? (deleting sys.out.print)
I am new to Android and I'm having problems. I have written a 15-game in java-code and now I'm about to implement it to an Android application.
I have written a method for printing out the state of the board to console in java with this:
public static void printBoard(Board board) {
for (int row = 0; row < 4; row++) {
for (int col = 0; col < 4; col++) {
if (board.getTile(row, col).getValue() == 0)
System.out.print(" ");
else
System.out.printf("%-3d",board.getTile(row,col)
.getValue());
}
System.out.println();
}
Now I have done the layout for the game and want to somehow write this method into a TextView. Problem is the System.out-print doens't work with android and the question is:
How can I write it into the TextView i've created? (deleting sys.out.print)
