massivemadness / Squircle-CE

👨‍💻 Squircle CE is a fast and free multi-language code editor for Android
https://play.google.com/store/apps/details?id=com.blacksquircle.ui
Apache License 2.0
1.38k stars 101 forks source link

SSH (or other) support in Squircle-CE for executing code in termux (or other compiler) #200

Open Dani3I opened 1 year ago

Dani3I commented 1 year ago

Is your feature request related to a problem? Please describe. It would be cool if I would be able to run code that I write in this code editor.

Describe alternatives you've considered

Describe the solution you'd like I am not sure if it is easy to do but I thought that maybe instead of integrating termux or entire compiler into this app (or making some other direct integration), it would be possible to create "simple" ssh (or other remote access - maybe some information about remote access on termux wiki will help: https://wiki.termux.com/wiki/Remote_Access ) client inside Squircle-CE, which would be connected to server created inside termux on this same android device. Maybe other app instead of termux would be also suitable: but I know only about "Nix-on-Droid" ( https://f-droid.org/packages/com.termux.nix/ ), which is Nix package manager inside port of termux if I understand correctly.

Additional context I have few ideas which would maybe simplify experience:

How I imagine it working in real world:

  1. You run (needed only at first time) command inside termux to have access to files on your device ("termux-setup-storage").
  2. You download compiler you want inside termux.
  3. You run SSH (or other remote access) server inside termux.
  4. You setup your Squircle-CE to connect to this SSH server (either automatically connect to SSH when you run Squircle-CE or via button inside app).
  5. You click button to run code. This button:
    1. opens "terminal" inside Squircle-CE (it might be on half of the screen or on completely separate screen or "tab"),
    2. runs command inside ssh which moves you into directory where file you want to compile is located,
    3. runs command that compiles code (probably based on extension of file you want to compile; but also probably it would be a good idea to have option to run compiler you selected),
    4. runs command that run compiled code and shows it inside ssh.

All of this might be also simplified, for example, as I said before, via script inside termux, and also in a way that for example, when you click button to run code in Squircle-CE, then it automatically detects if compiler for language you want to run is present - if not then it downloads it.

Also, instead of moving into directory where file is located, there might be some dedicated directory for Squircle-CE.

Also, of course I guess there might be more buttons, for example to only compile code etc.

massivemadness commented 1 year ago

Hi @Dani3I, thank you for well formatted and described issue.

I absolutely understand the need of this feature, however the termux has very unintuitive and poorly documented SDK (it's just my personal opinion), which greatly hinders development. Last time I looked into integration I ran into a problem where I/O didn't work at all, I couldn't send a command and receive the output even with all the permissions granted.

I don't want to go through the same steps over and over again because I have other high priority projects right now, but if I find some good integration examples I'll try to make it work 🙆‍♂️