Arduino mobile editor

I am attempting to make a mobile Arduino sketch editor, and am looking for any pointers.
My planned infrastructure is:

  • editor using webview and Monaco (powers visual studio code)
  • Possibly a custom keyboard built native, for faster programming
  • Avrdude (written in c or c++, I can't remember which) compiled for android and esptool with a python emulator and underlying serial management rewritten for native
  • Possibly integration with Arduino cloud to save sketches as well as local, by pretending to be the website

Any pointers, tips or general "don't do this" is helpful, thanks!
This is being made in android studio

I'm a 100% for this thing. It's been years I opened a topic here to find a way to do stuff like this.

One thing that I would need of this type of application is a button to export the compiled files. The same as in the IDE when you go to Sketch > Export compiled binary

Another good thing (that I would love to have in the Arduino IDE also) is to color the brackets by paires. Like this if you have several if statements, you know what bracket is for which IF statement

Hi @antxd. I suggest taking a look at leveraging the official Arduino CLI tool for things like library installation/updates, orchestrating the sketch compilation, and generating the upload commands:

Arduino CLI provides most of the non-GUI capabilities for Arduino IDE 2.x. It is also used by the 3rd party Arduino VS Code extensions (both the original, but now abandoned one created by Microsoft, the community fork of that extension, and the new

This tool is written in the Go programming language. Although there are sure to be difficulties, I think this at least means there is a better chance of being able to build it for the architecture of the target mobile devices.

In addition to the command line interface implied by the "CLI" in its name, Arduino CLI also provides a powerful gRPC interface for integration with your application. This interface is used by Arduino IDE. There is an overview of that subject here:

https://arduino.github.io/arduino-cli/latest/integration-options/

Thanks for the pointers
I will take a look at the Arduino cli when I get time, and while it simplifies a lot of the logic on my end, it also locks me to specific tools and adds another language to manage, compile and bundle - and if it was targeted to terminals (cli), it could be an issue interacting with it in android.
As for the coloured brackets, that should be relatively easy - I am fairly sure Monaco supports plugins, and if not should be fairly easy to implement.
I will add the option to export the binary, which could be made troublesome depending on the Arduino cli.

I think you are underestimating how much work it would be to redundantly implement the functionality provided by Arduino CLI. If you do that, you will probably end up hard coding the compilation and upload orchestration systems for your target boards instead of using the configurations specified by the Arduino boards platform. That approach will make it difficult for you to add support for additional boards, and to update the existing boards support as the platforms evolve over time.

I see.. I was under the false assumption that the Avrdude and esptool managed most of it, but I guess not.
I will implement the Arduino cli, as I want to leverage what is already made, and want to avoid what other projects like this have done, so that I can support a wide range.
Thanks for clarifying that

Meh, I can’t imagine ever wanting to use such a thing. When I write and debug code I use a PC with two BIG monitors (and sometimes that’s not even enough display real estate to view multiple function definitions, trace variable declarations, monitor debug prints, etc). Add to that a real keyboard and mouse to make editing and copy / paste operations easy.

Contrast that with shrinking your entire view of the project down to a tiny phone (or even tablet) screen, entering code with an even tinier on-screen keyboard, and trying to select / copy / paste with an even tinier curser. All manipulated using only your thumbs.

No thanks.

Are you aware that nowadays smartphones can be connected to all of what you use with your computer?

Are you also aware that some people cannot really afford a PC?

Also, people could need to change like just a constant in a sketch already done (on your beloved computer) and do it quickly on the fly with the phone

Could be interesting while traveling or at least not near the computer to do some work.

Do you intend to have it working without internet connection too?

Several people find this appealing from an old topic I found that inspired this. I'm also doing it for fun, and as a challenge.
It is more meant for tablets, but works for mobile.
I plan to add a custom keyboard - organised to be similar to a pc keyboard, but with gestures and a custom dictionary (keyboards on mobile are optimised so the next letter in the words you are most likely to type have bigger "hitbixes").
The bigger screen also comes with a bigger keyboard, maybe around the size of a portable keyboard, so if you place your tablet on a table or your lap or another flat surface, you can code pretty dang fast.
Another idea I could add is to pair your phone and utilise your full iPad as a keyboard - since most people have a phone. This gives you a "monitor" and "keyboard".

Yes, it is fully offline, but I aim for it to connect to Arduino cloud if possible.

I think they are not a programmers...

If you want to get some idea of how much demand there is for such a thing, use the search term "ArduinoDroid". This is the most popular app for developing Arduino sketch projects on mobile devices. I think there is currently an opportunity to make an alternative because there hasn't been a new release of the ArduinoDroid project in four years and some people are reporting that it is not compatible with the modern mobile devices/Android version.

I also think that the community would be very interested in an open source app, even if the ArduinoDroid developer started maintaining the app again at some point in the future, as unfortunately the ArduinoDroid app is proprietary.

I plan to make it open source, yes.
I personally have no business paying to put it on the play store or spending time to maintain it that much.
I am planning on having my opinion change, depending on how the project goes, and how interested the community is in it.
It will always be open source though.

But all people using Arduino don't need to be programmers... that's the point of Arduino.

Exactly.
People with bad laptops/PCs but good phones/iPads are a lot more common than you think. People are more interested in the newest console or iPhone than a 4080 ti in their pc.
Edit: I asked for tips, not debating on the purpose of this project? If you have an objection about anything related to the purpose of the project, please do not let me know.

Serious programmers...

At least until Android 14, it works.

My statement was based on this topic:

I haven't ever used ArduinoDroid (and don't have any interest in it), and have an old phone I never use that won't update past Android 10 anyway.

I run android 11 on a decently old phone, and it says it was made for an older version of android.