user11609: I downloaded the binary of Android Stockfish arm64-v8a and looked in the CPP source files. In main() there is all initialization, and then there is UCI::loop(), which catches standard input with getline() and writes back with sync_cout(). How can I write to the engine from a c# (xamarin) application? And is it necessary to make some additional initialization?
I found this,
which could be close to my problem, but maybe it is not. I don't want to spend three days just to see I'm doing complete nonsense.
Also I don't know how to recognize Stockfish's console. Is there only one console, no matter how many different libraries the program can use?
As I don't understand the technical part much, I'm including a screenshot of what I expect to be the Stockfish I should communicate with :-). If it is wrong from the beginning, please let me know.

EDIT: What file type is the stockfish-8-arm64-v8a, is it android native library or native shell executable or something else? Where to put the file, how to set it up (in Visual Studio 2015), how to call it from code? I have some code that I tried here but still I can't make it work.

user11609: Finally I made it work with big help of @SmallChess and @Andrew. The first problem came with file stockfish-8-armeabi-v7a with no extension and not much informations about. That's why I asked here. The answer by SmallChess was precise, I just couldn't make things work and I couldn't confirm it for very long time. I run into various problems, more or less easy to deal with, but this one took a lot of time:

I correctly copied the file to folder of my application, but I didn't have permission to run it.

So I had to change it with
string[] cmd = { "chmod", "744", Path.Combine(strToFolder, fileName) };
Java.Lang.Runtime.GetRuntime().Exec(cmd);

and things started to be very easy from now, as Andrew's answer provides fully functional code, which would take also a lot of time to write with not much understanding of the problem, so big thanks to him too.

user825: You're using the compiled Stockfish binary so you don't need to worry anything about C++. You only need to think about C++ if you're compiling the Stockfish source code yourself (but you're not).
The link you have is about calling a DLL in C# - this has nothing to what you want to do. The Stockfish program you have is independently compiled, and has nothing to do with Microsoft's DLL implementation.
You're looking for this:

https://stackoverflow.com/questions/4291912/process-start-how-to-get-the-output

You should start a new engine process, run it and communicate with the engine by UCI protocol.
EDIT:
I see you have started +100 bounty, but I think it's a mistake. I believe my answer is accurate but I'm unable to debug your environment. Your problem is the unknown file path. Have you added a text file, and try to read it in your app? If you can't load a text file in your program, you can't start a chess engine. Please give a go.

Save a new text file to where you have the Stockfish engine
Try to read the text file
You may want to do it on a simulator. On your PC simulator, you can use path like C:\Engine\SF_engine.

Your technical difficulty has nothing to do with chess engine or UCI protocol, and thus off-topic here.

user12: When you're using C#, you can use any UCI engine in the same manner.  With C# you have to add an event handler to the OutputDataReceived event (and optionally the ErrorDataReceived event).  As a quick example:
ProcessStartInfo si = new ProcessStartInfo() {
    FileName = uciPath,
    UseShellExecute = false,
    CreateNoWindow = true,
    RedirectStandardError = true,
    RedirectStandardInput = true,
    RedirectStandardOutput = true
};

myProcess = new Process();
myProcess.StartInfo = si;
try {
    // throws an exception on win98
    myProcess.PriorityClass = ProcessPriorityClass.BelowNormal;
} catch { }

myProcess.OutputDataReceived += new DataReceivedEventHandler(myProcess_OutputDataReceived);

myProcess.Start();
myProcess.BeginErrorReadLine();
myProcess.BeginOutputReadLine();

SendLine("uci");
SendLine("isready");
SendLine("ucinewgame");

And the methods alluded to above:
    private void SendLine(string command) {
        myProcess.StandardInput.WriteLine(command);
        myProcess.StandardInput.Flush();
    }

    private void myProcess_OutputDataReceived(object sender, DataReceivedEventArgs e) {
        string text = e.Data;
        //Debug.WriteLine("[UCI] " + text);
    }

This is an incredibly simplified example.  In my own code I have a semaphore in order to fully process each output line before moving on to the next one and several semaphores in the UCI start and "isready" handling.
For a full overview of the UCI protocol, check out the specification.

11609: <p>I downloaded the binary of Android Stockfish arm64-v8a and looked in the CPP source files. In main() there is all initialization, and then there is UCI::loop(), which catches standard input with getline() and writes back with sync_cout(). How can I write to the engine from a c# (xamarin) application? And is it necessary to make some additional initialization?</p>

<p>I found <a href="https://stackoverflow.com/questions/1579074/redirect-stdoutstderr-on-a-c-sharp-windows-service">this</a>,
which could be close to my problem, but maybe it is not. I don't want to spend three days just to see I'm doing complete nonsense.</p>

<p>Also I don't know how to recognize Stockfish's console. Is there only one console, no matter how many different libraries the program can use?</p>

<p>As I don't understand the technical part much, I'm including a screenshot of what I expect to be the Stockfish I should communicate with :-). If it is wrong from the beginning, please let me know.</p>

<p><a href="https://i.stack.imgur.com/iNCVm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iNCVm.png" alt="enter image description here"></a></p>

<p><strong>EDIT</strong>: What file type is the stockfish-8-arm64-v8a, is it android native library or native shell executable or something else? Where to put the file, how to set it up (in Visual Studio 2015), how to call it from code? I have some code that I tried <a href="https://stackoverflow.com/questions/44267734/how-to-run-compiled-binary-file-on-android">here</a> but still I can't make it work.</p>
 11609: <p>Finally I made it work with big help of @SmallChess and @Andrew. The first problem came with file <code>stockfish-8-armeabi-v7a</code> with no extension and not much informations about. That's why I asked here. The answer by SmallChess was precise, I just couldn't make things work and I couldn't confirm it for very long time. I run into various problems, more or less easy to deal with, but this one took a lot of time:</p>

<blockquote>
  <p>I correctly copied the file to folder of my application, but I didn't have permission to run it.</p>
</blockquote>

<p>So I had to change it with</p>

<pre><code>string[] cmd = { "chmod", "744", Path.Combine(strToFolder, fileName) };
Java.Lang.Runtime.GetRuntime().Exec(cmd);
</code></pre>

<p>and things started to be very easy from now, as Andrew's answer provides fully functional code, which would take also a lot of time to write with not much understanding of the problem, so big thanks to him too.</p>
 825: <p>You're using the compiled Stockfish binary so you don't need to worry anything about C++. You only need to think about C++ if you're compiling the Stockfish source code yourself (but you're not).</p>

<p>The link you have is about calling a DLL in C# - this has nothing to what you want to do. The Stockfish program you have is independently compiled, and has nothing to do with Microsoft's DLL implementation.</p>

<p>You're looking for this:</p>

<blockquote>
  <p><a href="https://stackoverflow.com/questions/4291912/process-start-how-to-get-the-output">https://stackoverflow.com/questions/4291912/process-start-how-to-get-the-output</a></p>
</blockquote>

<p>You should start a new engine process, run it and communicate with the engine by UCI protocol.</p>

<p><strong>EDIT:</strong></p>

<p>I see you have started +100 bounty, but I think it's a <strong>mistake</strong>. I believe my answer is accurate but I'm unable to debug your environment. Your problem is the unknown file path. Have you added a text file, and try to read it in your app? If you can't load a text file in your program, you can't start a chess engine. Please give a go.</p>

<ul>
<li>Save a new text file to where you have the Stockfish engine</li>
<li>Try to read the text file</li>
<li>You may want to do it on a simulator. On your PC simulator, you can use path like <code>C:\Engine\SF_engine</code>.</li>
</ul>

<p>Your technical difficulty has nothing to do with chess engine or UCI protocol, and thus off-topic here.</p>
 12: <p>When you're using C#, you can use any UCI engine in the same manner.  With C# you have to add an event handler to the <code>OutputDataReceived</code> event (and optionally the <code>ErrorDataReceived</code> event).  As a quick example:</p>

<pre><code>ProcessStartInfo si = new ProcessStartInfo() {
    FileName = uciPath,
    UseShellExecute = false,
    CreateNoWindow = true,
    RedirectStandardError = true,
    RedirectStandardInput = true,
    RedirectStandardOutput = true
};

myProcess = new Process();
myProcess.StartInfo = si;
try {
    // throws an exception on win98
    myProcess.PriorityClass = ProcessPriorityClass.BelowNormal;
} catch { }

myProcess.OutputDataReceived += new DataReceivedEventHandler(myProcess_OutputDataReceived);

myProcess.Start();
myProcess.BeginErrorReadLine();
myProcess.BeginOutputReadLine();

SendLine("uci");
SendLine("isready");
SendLine("ucinewgame");
</code></pre>

<p>And the methods alluded to above:</p>

<pre><code>    private void SendLine(string command) {
        myProcess.StandardInput.WriteLine(command);
        myProcess.StandardInput.Flush();
    }

    private void myProcess_OutputDataReceived(object sender, DataReceivedEventArgs e) {
        string text = e.Data;
        //Debug.WriteLine("[UCI] " + text);
    }
</code></pre>

<p>This is an incredibly simplified example.  In my own code I have a semaphore in order to fully process each output line before moving on to the next one and several semaphores in the UCI start and "isready" handling.</p>

<p>For a full overview of the UCI protocol, <a href="http://www.saremba.de/chessgml/standards/pgn/pgn-complete.htm" rel="nofollow noreferrer">check out the specification</a>.</p>
