void handleTelnet() {
...
if (telnetClient && telnetClient.connected() && telnetClient.available()) {
String cmd = telnetClient.readStringUntil('\n'); cmd.trim();
if (cmd == "status") {
...
EDIT: Thanks @yjftsjthsd-h and @detaro for your suggestions! I tried Telnet via tmux - it worked. Then I tried telnet directly, and it suddenly worked too. Turns out Arduino’s Telnet implementation is single-user only, and my dev machine’s reconnect loop kept the connection open; the working login just fooled me.I still haven't had the luck to have a fully working Home Assistant running inside (rooted) Termux.
Anyone succeeded to start `hass` and have it running without throwing errors?
There is also Linux Deploy[1] that automates the process of setting up chroot, ssh and even gui desktop (through framebuffer).
what are your thoughts on something like https://userland.tech/download/ which can just straight up boot up into any distro that you might need (you can use something like alpine/debian/archlinux)
they are open source too btw
and also I tried and if you have a server running, then there are ways to make it so that those web servers can be accessed from outside out of the box as well so there is nothing to worry about that either.
It doesn't require root either, I run it on an unrooted phone!
Quick fix, was to add `~/.bazelrc` this:
common --experimental_collect_system_network_usage=false
and then it works! Though sometimes I need to first `termux-chroot` and then it it handles cases, where some tooling expects `/usr/bin` and not `/mnt/data/com.termux/files/usr/bin`On measurements it's a bit 2x, 3x slower than Crostini (Termina) on Chromebook, but being available (so far) on all my Android devices is just awesome!
And there exist X11 too!
I wish there would be backdoor for F-Droid in the future, though maybe not as it seems :(
Highly recommended.
I coded some python with micro in alpine in userland on my phone.
I really really enjoyed it, like more than my pc for that day. I am proud of it.
> I coded some python with micro in alpine in userland on my phone.
Nice to see I'm not the only smartphone programmer around...
PlatformIO is providing C binaries that have dependencies.
Please PlatformIO ship your binaries statically so that we can run them everywhere.
I had the same problem on Alpine.
webdevver•20h ago
theres so much cool hardware on modern smartphones, with quite solid drivers by virtue of the (relatively stringent) android quality requirements, and its all locked away. video encoders, decoders, 3d accelerators, etc, but none of it is really accessible in a power-user kind of way.
some more thoughts...
the android development kit really is very heavy. compared to `gcc -o main main.cpp && ./main`, it is several orders of magnitude away.
the jetpack stuff and whatnot - the big android app shops probably do actually appreciate that stuff. but i wish the dev env 'scaled to zero' as they say, but in the sense of cognitive overload.
could it be time to move away from java, and shift towards everything being a native binary? we have the tools now to make it secure, and its not like phones get faster 'for free' anymore. it would also vastly simplify the developer experience.
nulld3v•18h ago
> the jetpack stuff and whatnot - the big android app shops probably do actually appreciate that stuff. but i wish the dev env 'scaled to zero' as they say, but in the sense of cognitive overload.
I tried to build a small binary that listens for events and launches/wakes an app to do some automation. But apparently there's no way to send Intents or Broadcasts from native code? So I need to boot a JVM in the binary if I want it to communicate with anything else on the system!
Of course, you can always communicate via stdio, but that's useless because everything in Android speaks Intents/Broadcasts. Native code can also do raw Binder calls, but nothing on the system speaks raw Binder.
ActorNightly•17h ago
There is "am" i think which can be invoked to do this.
However, Termux API exists, and is a nice package for calling other services. They have the scripts interface, which calls the actual app over a socket. Kinda inefficient, but at least the work is done.
nulld3v•13h ago
I believe the Termux API relies on a Java/app process that runs in the background to do stuff in response to API calls. Though I guess you get it for free if you already have the API running for other reasons.
seba_dos1•17h ago
vallassy•16h ago
matheusmoreira•7h ago
pabs3•25m ago
Otherwise for full Linux, take a look at shipping-with-Android devices that are semi-supported by postmarketOS, Mobian etc. Or go with vendors focused on non-Android Linux like Pine64 PinePhone, Purism Librem, Furilabs, Liberux and maybe some I forgot. The Debian Mobile wiki page has a whole lot of other links but I stopped maintaining it.
https://pine64.org/devices/pinephone/ https://puri.sm/products/librem-5/ https://furilabs.com/ https://liberux.net/ https://wiki.debian.org/Mobile
nunobrito•15h ago
Has a power user, what has your experience been on that topic?
I'd switch my phone to linux on a heartbeat because android apps seem compatible enough nowadays to run there too but battery is always the pressing limitation.
My thanks in advance.
seba_dos1•14h ago
That's not a universal property of these devices though - N900 that I used previously could easily last a few days.
Imustaskforhelp•13h ago
I am seriously interested in linux phones... like I am interested in either getting a grapheneos phone or somehow looking through my old garage of parents phones to see if any phone can be linux'd
I don't want to spend money right away but I am also a teenager, but the thing that's kinda stopping me from spending is that terminal can already be done through things like termux and the question I am asking myself is: is it good enough I have written back to back comments about it on why I think running android on linux using waydroid seems more performant than vice versa but I am curious.
Are there any recommendations that you have for me? I want to get linux on my phone but I am pretty sure that there are no second hand linux phones and I think it might cost me a lot of money (well for my country) anyway and I feel like the issue for me not being able to tinker is monetary of sorts.
pabs3•33m ago
https://pine64.org/devices/pinephone/ https://postmarketos.org/
The PinePhone also has the advantage that the proprietary Linux distro running on the ARM processor within the modem can be replaced with a fully open source distro. I think the Hexagon processor in the modem can't be replaced yet.
https://themodemdistro.com/ https://github.com/the-modem-distro/
See also the Debian Mobile wiki page, which is fairly unmaintained these days.
https://wiki.debian.org/Mobile
flykespice•6h ago
I am interested to hear how you deal with that as a full linux phone user
pabs3•23m ago
https://grapheneos.org/articles/attestation-compatibility-gu...
kees99•17h ago
https://github.com/cnlohr/rawdrawandroid
Imustaskforhelp•13h ago
I have been thinking more and more about creating golang applications for android simply because of how much I admire f-droid.
There are apps that have done this through 2 approaches
https://github.com/xlab/android-go?tab=readme-ov-file (Either something like this) Or https://github.com/LeastAuthority/destiny which is a dart app but uses golang's backend using https://github.com/LeastAuthority/dart_wormhole_william TLDR: they create dart bindings to go code and run it on android...
I know sooo many good golang applications on linux that I wish more people of android could access it and in an even nice way via something like f-droid so I am definitely contemplating what might be the best way for something like this...
For rust applications, I think that tauri might make the most sense, but I am just curious as to what you guys think is the best way for a beginner to create a golang/rust android application without worrying *too much*
pjmlp•7h ago
Also NDK is designed to produce shared libraries that are then loaded into the Java host process for the application, if not manually written, one gets the generic activity (NativeActivity or GameActivity) written by the Android team, expecting specific symbols on the shared library mapping to the native method declarations.
https://developer.android.com/reference/android/app/NativeAc...
https://developer.android.com/games/agdk/game-activity
So while someone's own APK might be Java free, there will be Java on the process execution runtime.
tonyhart7•7h ago
they literally do just that for fuchsia, but idk if google can pull this off tbh the tech DEBT is huge and massive undertaking that even google can be nervous
I mean this is their own fault too tbh, imagine windows that try to release every new release every year and try hard to add feature on top of that and it break down all API underneath
that's what happen to android and ios is