TMS Cloud connection and TAniIndicator with thread

Hi,

I develop in Android platform.

I want to show an AniIndicator during cloud connection process (during call of .connect proc of my cloud)

But, as TMS Cloud are form component, I need to call .connect with Synchronize method.

So, this blocks the main thread and my animation freeze.

A solution ?

Hi,


We have no experience with using TMS FMX Cloud Pack components in combination with TAniIndicator.
Can you please provide a code sample so I can further investigate this?

Hi,


A sample :

      Task := TTask.Create(procedure()
      var
        bConn: Boolean;
      begin
        Sleep(2000);   // To see aniindicator run

        // Connexion au cloud
        TThread.Synchronize(TThread.CurrentThread, procedure()
        begin
          bConn := CloudStorage.Connect;
        end);

        // Chargement de l'arborescence des fichiers
        if (bConn) then
        begin
          TThread.Synchronize(TThread.CurrentThread, procedure()
          begin
            TMSFMXCloudTreeViewAdapter.CloudStorage :=dmSync.CloudStorage;
            TMSFMXCloudTreeViewAdapter.InitRoot;
            aiAttente.Enabled     := False; 
          end);
        end;
               
      end);

      Task.Start;

To access FMX Cloud component, we need to use Synchronize call. But this lock the main thread, this task has no interest and the AniIndicator freeze during cloud process.


I'm not sure what is going wrong here.

Can you please provide the following information so I can further investigate this?

- Does the issue only occur on Android or also on Windows
- Which version of Android are you using?
- A ready to run sample project that demonstrates the issue
(Sample projects can be emailed as attachment to mailto:help@tmssoftware.com)

Bart Holvoet2019-06-19 17:05:27