How to make an app - Andromo App Maker


No announcement yet.

Multi Thread

  • Filter
  • Time
  • Show
Clear All
new posts

  • Multi Thread

    Hi, I wanted to run a command line process that runs and does not hang in the thread
    I already used the plugin and did not respond and crash Please help me very need

  • #2
    Hi , Welcome to the forums
    Please explain, we are not mind readers
    What command are you trying to run? Please an example of your code


    • #3

      this is example I want to run your multi thread project and do not use the plugin because it has a bug plugin and crash program and not working buuton Android ADB


      • #4
        I do not use this device but assuming you have the drivers installed you can try something like this ...

        File.Run ("adb.exe", "install" C: //apk path//myapp.apk "")


        • #5
          iwant run to multi thread and need log


          • #6
            I also have not used this [commandline application] but maybe try -
            adb -e install -r abc.apk
            adb -d install -r abc.apk
            adb logcat | FINDSTR “msg for filter"

            webpage :


            • #7
              Originally posted by milad0382 View Post
              this is example I want to run your multi thread project and do not use the plugin because it has a bug plugin and crash program and not working buuton
              The CommandLine plugin does not have a bug. It's actually your code which is buggy and which is causing your application to hang. Firstly, the string currently being returned to your Command variable is:
              _SourceFolder.."\\AutoPlay\\Docs\\adb\\adb.exe install "MyFilePath\MyAndroidFile.apk"
              You're attempting a command line action here, so you'll need to omit those quote marks enclosing the filepath to your .apk file. Recode Line-8 so that it returns:
              _SourceFolder.."\\AutoPlay\\Docs\\adb\\adb.exe install MyFilePath\MyAndroidFile.apk
              ... But first ensure your command line action is working as intended by checking it manually at the command prompt. We don't have a copy of the .apk file you're trying to install, nor do most of us currently have an Android device hooked up on which to test the apk package - so you'll have to check that first on your own. The command line action may need some restructuring (such as that which colc has indicated above). Test it manually at the command prompt to find out.

              The second issue is that at Line-10, you've instructed AMS to retrieve Paragraph info from your LastLog variable - but there is nowhere in your code indicating from where this variable is retrieving its data. CommandLine.Execute() pipes in an indexed table containing the following 3 values: StdOut, StdError & ExitCode. You've correctly instructed AMS to return the first indexed item back to the Paragraph object (ie. Result.StdOut) but have not coded in a source for the data from your LastLog variable. (And, keep in mind that the data from StdOut will get returned ONLY if your command string is correctly structured).

              Lastly, you say you require multi-threading? AMS is single-threaded only. So if you require multi-threading (for whatever reason), then you'll need to make use of either the MultiThread Object plugin (by LucasTheDuck) or LuaLanes (by Asko Kauppi).


              • #8
                HI friends can you help for Multi thread how to run scrip in multi thread


                • #9
                  As stated, for multi-threading you'll require the aforementioned plugin or the lua lanes module. Or you can use an approach something akin to multi-threading with co-routines (although this is not real multi-threading).

                  The attached example is a basic demonstration of how the MultiThread object plugin (Pabloko aka. LucasTheDuck) works. (Take note that it won't work with for loops).

                  You can also use the SpawnerEx DLL to start additional threads without blocking your main application. See webultra's example here
                  Attached Files


                  • #10
                    Originally posted by BioHazard View Post
                    (Take note that it won't work with for loops).
                    For loops don't work in the MultiThread plugin? If that's the case and the MultiThread plugin really uses threads, it's not supporting loops because lua_lock and lua_unlock are not implemented in IR's build of Lua 5.1. If those are implemented, the Lua state will synchronise between threads - but become a bit slower.
                    Bas Groothedde
                    Imagine Programming :: Blog

                    AMS8 Plugins
                    IMXLH Compiler


                    • #11
                      Hmm, interesting. There's a link to the author's thread (external) on the demo attached above. Reference to the 'for loop' failure is made on the 3rd page of that thread and it seems the issue was never addressed.

                      I think Ulrich also had some kind of Multthread plugin out at some stage (which might be a better option) - though I can't see it on his website anymore. Anyone know whatever became of that plugin?