1

As an alternative to having to create an “external” in c/c++/objc to a new Livecode application, I have developed instead a Python network socket app that communicates with it via sockets. The reason for this is that I needed to use some functions provided by some of my “custom” Python libraries. These functions are not doable in Livecode natively at this time. The communication between the Livecode and the Python apps works just as I desire.

I have only tested this technique in a desktop app on OSX for now. When saving the standalone, I’ve bundled my compiled Python app in the “Standalone LC Application Settings” and the whole thing installs and works without problems.

Now, can the same task possibly be accomplished for IOS and/or Android apps? Can I bundle a compiled Python script with a Livecode IOS/Android mobile app in order to run in these devices? I’m aware of course, that Python is not installed by default in either IOS or Android. What is the best way to accomplish this then? I’m pretty new to Livecode. I’ve tested my Python script on Pythonista on both an iPhone and an iPad just to make sure it will run and it works flawlessly there. So, how do I package my Livecode app with my python script so they could be both installed and ran in the mobile devices?

1 Answers1

1

How do you call your Python scripts? The Shell command is not available on mobile so I guess you would need to create an external that would call your compiled script. But then sockets isn't available either on mobile yet (will soon be afaik). But out of curiosity what is your python script doing that can't be done in LiveCode?

hliljegren
  • 426
  • 3
  • 9
  • +1 either an external or install the python scripts on a server somewhere. There's a couple of socket externals around so don't let that stop you from the server solution. Certainly interested in what the scripts do. – Monte Goulding Nov 17 '13 at 21:39
  • 1
    I just found this: http://elmer.sourceforge.net... doesn't look hard to use this to generate the C bindings for an external. – Monte Goulding Nov 17 '13 at 22:11
  • The Python scripts which, as I’ve described, are called from the “client” Livecode app are communicating with the “Server” in a typical Client/Server fashion via network sockets. The server is the sockets server that I’ve coded in Python. The server receives the Python scripts from its client and executes them locally in real time. Ideally, this socket server could reside on the mobile just as it already does in the desktop as an “external” to the LC app. Again, this scenario is already working fine on my desktop. – user2988903 Nov 20 '13 at 02:12
  • The server could live anywhere in the “cloud”, of course, but this is not practical for this type of mobile app, where timing is crucial. The “Shell” execution paradigm cannot be used on mobile at this time. The sockets server here, is using among other libs, a custom MIDI library which I need for this app since Livecode does not speak MIDI unfortunately. – user2988903 Nov 20 '13 at 02:13
  • Thank you Monte for the “Elmer” glue :-) great stuff, it might help. I need to try it with an LC external. Or I might take the C/C++/Obj C route natively and forget about the sockets at this time. The MIDI functions would have to be called directly from within the external then. So is developing my own custom external, the only feasible solution in this case? Ok…Back to the drawing board… – user2988903 Nov 20 '13 at 02:16