I'm looking for a way to execute a chess engine (Stockfish, for example) without having to use NDK and JNI.
The main issue I have is, how to execute a software (like in a prompt) and keep it running as it send to me the outputs.
The second and more specific issue is how to get the installed chess engines on the device, if it is possible (and if there is a way to make use of them).
below I tell in details I want to achieve
I don't know if what I want to do is even possible, so I will explain: when you install a chess engine app, like Komodo or Stockfish, when you execute them you see a message informing that you have to download a GUI app in order to it to work as a fully chess program. What anyone can infer from these messages is that a GUI App can make use of an installed engine in a device.
Is there a way to see the installed engines on the device to show on an select box, and "extract" these engines from the apps, or to find the location of them in the device, or to execute the apps via another way similar to intents?
The problem is that a chess engine is a software that has to be kept running to avail a position; you send them the position you like them to avail and as they analyse, they keep sending you their avaliation, and they keep doind this until you send them a comand to stop.
If you execute the Stockfish in the prompt of the Windows, you can see clearly what I am talking about. When it execute, it waits for a command; them you send a comand "uci"; then you send a comand like "position fen ", then you send "go infinite" and they start calculating and kept sending output about their calculation.
So, I would like to create an app that make use of the installed engines in the device.
Until now I didn't discover how to do that. I had to download the DoidFish app source code and analysed what they did... and they got the source code of stockfish and executed it with JNI.
But that way I would have a fixed and limited engine list on my app, and I would be leaving out the engines which have no opened source, like Komodo and Houdini. I see that the Chessbase app can use several engines, as you can see in the screenshots in the app's page. They also showed the Komodo engine in the list (as I purchase the app to see)... I have Komodo installed... So they had to do in some other way...
As I couldn't solve the mistery, I downloaded the compiled arm version of the stockfish, and tried to execute it with the Runtime's exec method like:
Runtime rt = Runtime.getRuntime();
String[] commands = {enginePath, "uci"};
Process proc = rt.exec(commands);
However an engine is a software that you have to execute, and it has to be kept running as you send comands to it as I explained before, but in this way I executed the engine, then it sent to me an output (I got with BufferedReader) and then stopped executing.
Sorry for a so big text, could you help me to figure that out?