Live data from Hacker News

ESP32 and Termux

blog.gavide.dev

31–40 of 57 posts

Re: ESP32 and Termux

#31
post #14

very cool. termux has to be peak for unbridled nerddom, the new linux terminal in android 16 is really a pale shadow of it. you don't get access to anything non-virtual, not even the gpu (atleast, i couldn't get it to work.) 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, decoder…

It is possible to write native code for Android using Native Development Kit. Typical NDK use would be to develop a library that is then called into by java code. But one can make whole app with it, 100% java-free: https://github.com/cnlohr/rawdrawandroid

It is never Java free outside games, because all relevant Android APIs are hidden behind JNI calls, implemented in Java.

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.

Re: ESP32 and Termux

#32

very cool. termux has to be peak for unbridled nerddom, the new linux terminal in android 16 is really a pale shadow of it. you don't get access to anything non-virtual, not even the gpu (atleast, i couldn't get it to work.) 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, decoder…

"could it be time to move away from java, and shift towards everything being a native binary?"

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

Re: ESP32 and Termux

#33
post #12

I've been playing with Termux, both on Chromebook (Eve), and my Samsung Galaxy S22 - pretty cool, though hit some issue with recent `bazel` - as newer versions try to access a `/dev` endpoint that's not available. 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…

hm you can try out userland https://userland.tech/download/ which runs it inside proot and you can use something like alpine or debian and they can actually make the vnc/installing gui setup actually pretty easy. 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.

Using proot and proot-distro is highly recommended in general. Extremely useful when one needs software not directly packaged by Termux.

> I coded some python with micro in alpine in userland on my phone.

Nice to see I'm not the only smartphone programmer around...

Re: ESP32 and Termux

#35

Earlier quoted context omitted.

You don't have to use Android. I've been using various GNU/Linux phones for the last 17 years, so being able to do `gcc -o main main.cpp && ./main` on a phone is just natural to me. Back in 2008, as a teenager, I could choose to spent my first earned money to get me either one of the first GNU/Linux phones on the market or the first Android phone, and I feel that as the time goes it only validates my decision.

I've been looking at Linux phones for a while, and now the latest 'sideloading' lockdown from Google has pushed me to seriously consider getting off Android. What phones do you use or recommend for someone who has a little Linux experience?

Smartphone Linux is a total mess. Even postmarketOS does not have a single fully supported and maintained device it can point to and say "buy this, you can run fully featured Linux on it". Very sad. The best option seems to be running Termux on GrapheneOS on the latest Pixels.

Re: ESP32 and Termux

#36

very cool. termux has to be peak for unbridled nerddom, the new linux terminal in android 16 is really a pale shadow of it. you don't get access to anything non-virtual, not even the gpu (atleast, i couldn't get it to work.) 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, decoder…

You don't have to use Android. I've been using various GNU/Linux phones for the last 17 years, so being able to do `gcc -o main main.cpp && ./main` on a phone is just natural to me. Back in 2008, as a teenager, I could choose to spent my first earned money to get me either one of the first GNU/Linux phones on the market or the first Android phone, and I feel that as the time goes it only validates my decision.

The only stopper for most of us fully moving to Linux phones are banking apps...

I am interested to hear how you deal with that as a full linux phone user

Re: ESP32 and Termux

#39

Earlier quoted context omitted.

I'm using a Librem 5 and its battery life is good enough for me - it lasts pretty much exactly what's needed for me to get through a typical day, so I often get home with the battery almost but not entirely flat. When I know that I'm going to be using it more intensively or need it to last longer, I'll usually just put a spare battery into my backpack, but I rarely actually need to use it when these days you can just…

Having a spare battery or being able to change battery seems like a fever dream for people on new android devices. 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…

The PinePhone is a cheaper phone supported by mobile Linux distros like postmarketOS, maybe look at that. The CPU is not as fast as the Librem though. postmarketOS has some support for a range of devices though, maybe one of them is cheaper used than the PinePhone for you.

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

Re: ESP32 and Termux

#40

Earlier quoted context omitted.

You don't have to use Android. I've been using various GNU/Linux phones for the last 17 years, so being able to do `gcc -o main main.cpp && ./main` on a phone is just natural to me. Back in 2008, as a teenager, I could choose to spent my first earned money to get me either one of the first GNU/Linux phones on the market or the first Android phone, and I feel that as the time goes it only validates my decision.

I've been looking at Linux phones for a while, and now the latest 'sideloading' lockdown from Google has pushed me to seriously consider getting off Android. What phones do you use or recommend for someone who has a little Linux experience?

Maybe start with GrapheneOS on a Google Pixel phone, its a privacy/security focused Android fork.

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

Post reply on HN