Live data from Hacker News

Rawdrawandroid – Build Android apps without any Java, in C and Make

github.com

71–80 of 157 posts

Re: Rawdrawandroid – Build Android apps without any Java, in C and Make

#71
to be clear, this is only really useful for applications that present their ui through opengl and do not interact with the rest of the android system very much.

the ndk is meant for writing little bits of c to speed things up in a classic java android application.

this is a pretty cool hack that allows for opengl apps to be written in straight c that run full screen and have limited access to things like keyboards, adc inputs or usb.

it does not include a reimplementation of the android frameworks in c and the ndk provides limited access for ndk code to interact with them.

the main use case seems to be supporting a program for live audio reactive visuals based on extraction of chroma.

Re: Rawdrawandroid – Build Android apps without any Java, in C and Make

#72
post #71

to be clear, this is only really useful for applications that present their ui through opengl and do not interact with the rest of the android system very much. the ndk is meant for writing little bits of c to speed things up in a classic java android application. this is a pretty cool hack that allows for opengl apps to be written in straight c that run full screen and have limited access to things like keyboards, a…

I read that last bit of your comment before I opened the link, and thought to myself, that's something Cnlohr would write.

And it is! Hah.

Re: Rawdrawandroid – Build Android apps without any Java, in C and Make

#73

"I can do anything I want. It's just bits. You don't own me." Fair enough! x-D

"This is computer science. There aren't restrictions." - It's literally what many people forget when they let themselves constraint by frameworks and claim this and that isn't possible. Very refreshing to see how liberating it is if you go one level deeper.

Re: Rawdrawandroid – Build Android apps without any Java, in C and Make

#74

Looks like you still have to start by installing Android Studio, which seems excessive. Is there a way to just download an Android SDK? Looking briefly at the makefile, I think they might have avoided Gradle, though it calls other tools written in Java. I'd love to see a way to build a Flutter app without Gradle.

> curl -k " https://dl.google.com/android/repository/commandlinetools-li... " -o commandlinetools-linux.zip unzip somewhere, set path variable > yes | sdkmanager --licenses && sdkmanager "platform-tools" && sdkmanager "ndk-bundle" && sdkmanager "build-tools;33.0.0" "platforms;android-33"

This is better indeed, but from recollection last time I tried this.. I think that still requires a full OpenJDK installation and I believe those `sdkmanager` commands install multiple GB of tools sadly.

Re: Rawdrawandroid – Build Android apps without any Java, in C and Make

#75

May be someone with deep pockets like Elon must get Linux to work on mobile. I know there's efforts going on but seems slow progress. That will break the back of the duopoly and also make things like this so much easier.

Already been done https://ubuntu-touch.io/en_GB/ I ran my main phone on this for a little while and it was definitely an interesting experience

Re: Rawdrawandroid – Build Android apps without any Java, in C and Make

#76

Looks like you still have to start by installing Android Studio, which seems excessive. Is there a way to just download an Android SDK? Looking briefly at the makefile, I think they might have avoided Gradle, though it calls other tools written in Java. I'd love to see a way to build a Flutter app without Gradle.

It's possible to build without gradle by calling the sdk tools for bundling and signing directly (for instance from make or cmake), but Android Studio is at least useful for debugging the resulting apk (AS also works as "standalone debugger" for debugging an apk built elsewhere).

Re: Rawdrawandroid – Build Android apps without any Java, in C and Make

#77
post #14
post #8

Earlier quoted context omitted.

If works with C why not Rust

Interfacing with C from Rust is harder, and Rust has fewer cross-compile targets. I'd expect Zig to be an easier deal here, with its zero-impedance interface with C.

> Interfacing with C from Rust is harder

Sure, harder, but not really all that difficult. Run bindgen over the NDK headers and see what happens. Sure, for ergonomics you'll want to write safe Rust wrappers. After that's done once, it's done.

> Rust has fewer cross-compile targets.

Not really an issue here. Rust supports all the targets Android runs on. Natively, even:

    $ rustup target list | grep android
    aarch64-linux-android
    arm-linux-androideabi
    armv7-linux-androideabi
    i686-linux-android
    thumbv7neon-linux-androideabi
    x86_64-linux-android

Re: Rawdrawandroid – Build Android apps without any Java, in C and Make

#78

Honestly the whole java/kotlin tooling is the worst to pick for mobile dev, and KEEP it after so many other great languages and tools that are out there. I don’t why google didn’t offer at least Go as a native alternative for android dev.

Because Go only exists due to a trio that doesn't like C++, has fought against Java 20 years ago and lost (Inferno and Limbo), and is pretty much the atenthesis of the feature rich capabilities of Java, Kotlin and C++, the official Android languages.

They hit jackpot with Kubernetes and Docker taking off after their pivot to Go.

Re: Rawdrawandroid – Build Android apps without any Java, in C and Make

#80
post #15
post #13

Now we only need to embed Lua into this to write the high-level logic, and we may have a winner for stuff that does not need a lot of accessibility support. Like, say, games, or media players. Easy to link C libraries that do performance-critical stuff, or writhe your own C code. (Then gradually rewrite the core in Zig.)

...I of course would rather embed Janet [1], but I realize what is going to have an easier time gaining popularity %) Also, Lua has Löve [2] which could be immediately usable, among other things. [1]: https://janet-lang.org/ [2]: https://www.love2d.org/

thanks for the link to janet! i hadn't heard of it before. a lot of lua energy even if it's a lot bigger
Post reply on HN