Jump to content

Felix.

Members
  • Content Count

    43
  • Joined

  • Last visited

Posts posted by Felix.


  1. Greetings to all,

    there's a useful piece of code in C# that can run process under Android:

            mProcess = new Process();
            ProcessStartInfo si = new ProcessStartInfo()
            {
                FileName = filepath,
                UseShellExecute = false,
                CreateNoWindow = true,
                RedirectStandardError = true,
                RedirectStandardInput = true,
                RedirectStandardOutput = true
            };
            mProcess.StartInfo = si;
            mProcess.OutputDataReceived += new DataReceivedEventHandler(MProcess_OutputDataReceived);
            mProcess.Start();
            mProcess.BeginErrorReadLine();
            mProcess.BeginOutputReadLine();

    Then it can send and receive commands to/from a file (program).

     

    Is there such analog in Delphi? (Firemonkey)

    Thanks!

     


  2. I use this code (Delphi 10.4, Firemonkey, Android):

    procedure TForm1.MoveButtonClick(Sender: TObject);
    begin
      var
      Time := 1.0;
      var
      P := Image1.Position.Point + TPointF.Create(200, 100);
      TAnimator.AnimateFloat(Image1, 'Position.X', P.X, Time);
      TAnimator.AnimateFloat(Image1, 'Position.Y', P.Y, Time);
    end;

    The question is how can I change Position.X and Position.Y simultaneously, so I can use it with AnimateFloatWait?

    There's an important procedure after animation that executes immediately (i.e. doesn't wait for the end of animation).

    I tried to use in thread, but also with success.


  3. 5 hours ago, Rollo62 said:

    I always try to use most basic components, to reduce possible problems.

    Like TToolbar => TLayout, and nested TLayout's for all other grouping when necessary, all together with TAlignLayout and Margins to achieve a responsive behaviour.

    Buttons I use TAlignLayout.Left, with Margins Left, Top, Bottom, so I can nicely arrange them one after the other.

     

    Can you show the screenshot of what you achieve? Just as an example. Thank you


  4. 3 hours ago, Diego Muñoz said:

    Hello! I developed chesslive.com (now offline, dead). I don't do it with Delphi, it was plain javascript but the system was:
    - backend with websockets. I think that you could search something about this tech with Delphi. Pub-Sub model, with websockets. It was really fast, playing thousands of simultaneous games (yeah, blitz! people like blitz).
    - client was vanilla javascript, but use websockets to talk with the servers.
    - The scheme was something like: player1: subscribe to the chanel with id (myGameId) server:ok create the channel player2: subscribe, player1: move, server: transmite the move to player2, player2: do the move and make my move, send to server... and so on. Is really easy.
    I hope that this info help you as one possible solution, at least, it is a real case! 🙂 🙂 🙂
    You could read: https://blogs.embarcadero.com/websockets-harness-real-time-power-in-your-delphi-apps/

     

    Thank you Diego!

    I think the main problem is backend. Can it be implemented with Delphi? Or do I need to learn Php/Node.Js/etc. ?

    What do you think about ESEGECE Websockets? I've heard they are best for mobile clients.


  5. Please point me in the right direction.

    I would like to create a very simple game server (only backend without GUI, JS and frontend) that will allow the users to play board games (checkers, mancala, backgammon). No AI, only blitz.

    The client program should be written with Firemonkey. I created already a Firemonkey project that allows the users to play against each other on one machine (smartphone), so GUI is not a problem.

     

    How hard/easy can it be done?

    Please recommend me links, resources, examples, etc.


  6. Greetings to all,
    I'm trying to create a simple Android app (using Delphi 10.4, Firemonkey) that will use stockfish engine (evaluate positions and suggest a best move).
    I downloaded stockfish .so files (ELF) for Android 32/64bit, included them in my app. In my program I use LoadLibrary, it returns success (Result <> 0). I read a lot about uci protocol  (isready, ucinewgame, etc.), but now how will I call stockfish engine and pass a FEN to it? Should I use GetProcAddress? (if yes, then with which parameters?)
    Has anyone a successful experience?

    Thank you in advance.


  7. I'm trying to create an Android app for chess players.

    I already wrote a code to parse PGN files, now my task is to display a chess board with pieces and allow the user to move pieces from one square to another.

     

    Please give me hints/tips/suggestions how to achieve it?

     

    Thanks in advance!

×