Android UCI engine - beginner questions

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

NoSQL
Posts: 12
Joined: Sun Sep 30, 2018 6:10 pm
Full name: Matthias Meier

Android UCI engine - beginner questions

Post by NoSQL »

Hi,

I'm new to Android Programming. I want to use my favourite Android chess GUI which doesn't allow to connect to a remote UCI engine but only to locally installed engines. My idea is to develop an Android app which looks like a local UCI engine for the GUI program and proxies all UCI communication from and to a remote UCI engine on a Linux server via stdin and stdout. The app contains only the configuration for remote server and port ...

My problem is that I do not know how the GUI connects to the UCI engine. Do I have to develop the an Android background service? And if yes, which methods do I have to implement? Is it onBind() or onStartCommand()? Are there any free Java sources which demonstrate how a Android UCI engine works?

Regards
NoSQL
User avatar
abik
Posts: 819
Joined: Fri Dec 01, 2006 10:46 pm
Location: Mountain View, CA, USA
Full name: Aart Bik

Re: Android UCI engine - beginner questions

Post by abik »

Just curious, what is your favorite chess GUI? And wouldn't it be a lot simpler to switch your favorite GUI to one that supports connecting to remote UCI engines. See my blog posting for Chess for Android (Wallner's links for the server-side tools need updating, but the concepts remain the same).
NoSQL
Posts: 12
Joined: Sun Sep 30, 2018 6:10 pm
Full name: Matthias Meier

Re: Android UCI engine - beginner questions

Post by NoSQL »

My favourite Android chess GUIs are "Chess PGN Master" and "Analyze This Pro". I've tested most Android chess GUIs, and I like those two most.

Yes, as a normal user it would be easiest to choose another GUI. But as an IT architect I like playing with technologies. And if I would know which interface to use, it would be easy to develop such a simple app which routes UCI commands to and from a remote engine via stdin/stdout.

And I want to find out how Android chess GUIs connect to UCI engines. What properties does an engine bring with it so that it is recognized as an engine with in the GUI?
User avatar
abik
Posts: 819
Joined: Fri Dec 01, 2006 10:46 pm
Location: Mountain View, CA, USA
Full name: Aart Bik

Re: Android UCI engine - beginner questions

Post by abik »

NoSQL wrote: Mon Oct 29, 2018 5:18 pmYes, as a normal user it would be easiest to choose another GUI. But as an IT architect I like playing with technologies. And if I would know which interface to use, it would be easy to develop such a simple app which routes UCI commands to and from a remote engine via stdin/stdout.
And I want to find out how Android chess GUIs connect to UCI engines. What properties does an engine bring with it so that it is recognized as an engine with in the GUI?
Fair enough. I was just curious if you wanted a quick way to get a server-client setup running or whether you were interested in the technical problem. In case of the former, I would offer my GUI as solution, but I completely understand the latter, I am like that as well.

An engine on Android is not an Android service but simply a binary (compiled for Android, either ARM or x86 depending on the device) that reads and writes from stdin/stdout. The GUI starts this binary as a process and communicates with it through pipes. Originally, the GUI needed to do a one-time "install" of the binary (where the user simply points the GUI to the binary). More and more engines on Android, however, are packaged and shipped using either the Android open exchange format (OEX) or the Android Chessbase compatible format. I have a rather elaborate write-up on this on my website. Hopefully this is helpful.
Ras
Posts: 2487
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: Android UCI engine - beginner questions

Post by Ras »

The easiest way forward would be to use the Android NDK (not the SDK) to develop the Android end of that proxy-engine. You can code in C/C++ and develop the whole thing under Linux, then re-compile for Android. Forwarding stdin/out via IP should be pretty straight forward. Of course, taking care of security will require some thought because you probably don't want anyone to be able to log in at your remote end.
Rasmus Althoff
https://www.ct800.net