Android: Calling a program from java extension

H

haza

Guest
Hi guys,
I know that Game maker allows you to call java via en extension. I'm currently developing a project where i call an external chess engine from java. My question is would I be able to make an android apk in game maker which included the chess engine (stockfish) arm file. I use the Runtime.getRuntime().exec to run the engine.

Here is the sample call.

public class Stockfish {

private Process engineProcess;
private BufferedReader processReader;
private OutputStreamWriter processWriter;

private static final String PATH = "../stockfish7x64";

/**
* Starts Stockfish engine as a process and initializes it
*
* @param None
* @return True on success. False otherwise
*/
public boolean startEngine() {
try {
engineProcess = Runtime.getRuntime().exec(PATH);
processReader = new BufferedReader(new InputStreamReader(
engineProcess.getInputStream()));
processWriter = new OutputStreamWriter(
engineProcess.getOutputStream());
} catch (Exception e) {
return false;
}
return true;
}
 
Top