Live data from Hacker News

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

github.com

81–90 of 157 posts

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

#81

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

cnlohr is in his own league, this guy is bordering on genius.

Dissatisfied with the state of the vendor SDK for CH32V003 microcontrollers (ultra-cheap RISC-V MCUs), he created his own [1], which is a pleasure to use. He also has a header-only RISC-V emulator that runs Linux (and Doom!) [2], and hacked an ESP32 to emit valid LORA frames with clever use of aliasing [3].

[1] https://github.com/cnlohr/ch32v003fun

[2] https://github.com/cnlohr/mini-rv32ima

[3] https://www.youtube.com/watch?v=eIdHBDSQHyw

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

#82
post #6

Earlier quoted context omitted.

> only to have Android Studio force me to update Gradle and dependencies and whatnot, and break everything This. And people are surprised that many just wrap websites as apps on Android.

If targeting Android people should first consider if their app can work as a PWA. Try and do it. if you run into a deal breaking issue with PWA features, then wrap it in a minimalist app shell. Best case: everything works on Android and iOS and it's also a website. Worst case: you will end up doing some platform specific code and dealing with the app stores like you were going to do anyway. Average Case: everything w…

I shipped a PWA in the Play Store. Guess what? It still got delisted because I didn't update to the latest API level or whatever.

Unfortunately you can't just ship a PWA with no wrapper. You have to build a special wrapper app that hosts the PWA and you have to use Android Studio and Gradle and all that crap.

Updating the wrapper is surely still easier than a whole app, but it's nontrivial and it's frustrating to still have to deal with the platform BS for a pure web app that uses no platform APIs at all. More work than I wanted to deal with for a hobby project, anyway.

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

#83
post #49

Earlier quoted context omitted.

Yes. Definitely. Ignore your blind rage of Gradle/Maven for a second and realize that they’re literally next iterations of Make.

It's not blind rage. I've used them, they're over-engineered crap, like most things Java, especially the abominations made at Apache land. You can't say Make is over-engineered; lacking, maybe, but it does what it's meant to do and not much of anything else.

Make can be as low level or high level as one wants. One simply runs shell commands with it mostly, except for in-built functions and using other shells. This means it all depends on the tooling one wants to use for a project. If it is a C project then probably some C compiler. If it is Python then probably some venv and Python. And so on. So it is very flexible. Only doesn't have a great syntax.

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

#84

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.

Not sure how useful this is but here's a gist that runs through the process without needing Android Studio: https://gist.github.com/jonnybrooks/13c6cbae832e7d1662e6c143...

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

#85
post #6

Earlier quoted context omitted.

> only to have Android Studio force me to update Gradle and dependencies and whatnot, and break everything This. And people are surprised that many just wrap websites as apps on Android.

If targeting Android people should first consider if their app can work as a PWA. Try and do it. if you run into a deal breaking issue with PWA features, then wrap it in a minimalist app shell. Best case: everything works on Android and iOS and it's also a website. Worst case: you will end up doing some platform specific code and dealing with the app stores like you were going to do anyway. Average Case: everything w…

I use most of the things as pages (miniflux, bluesky) and feel no need to install apps for them....

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

#86
post #5
post #2

This is pretty great. The biggest reason I hate doing android development is the java (and to a lesser extent, kotlin) "ecosystem" is a pain. Java is a sucky language to write; Kotlin is less bad, but the whole build tooling/package management/IDE mania mess is still a hassle to use. So thanks to the author.

I can tolerate Java and Kotlin, but the tooling is just awful *. I've stopped counting how many times I came back to an Android project after only a few months, only to have Android Studio force me to update Gradle and dependencies and whatnot, and break everything. * Of course one could blame me for not learning the ins and outs of the build system!

Eh... "all hail Gradle" :/

Each time I have to touch it, it results in problems... Oh, you updated JDK? Gradle won't work. There is new Gradle? Tough luck it will break your build..

And with Maven it can update and the build keeps working just fine.

To that end I mostly ignore prompt "update gradle!" in Android Studio to avoid any issues...

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

#87
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…

To be fair this is the way to not be platform dependent and more people should pursue it.

I'm doing a desktop app meant to be as cross compatible as possible and the only reasonable way to do it (without sending yourself into build config hell) is with opengl.

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

#88
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…

> 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's not even a hack. Android NDK added that way back in like gingerbread, it's just a NativeActivity. https://developer.android.com/ndk/samples/sample_na

This is just a small framework on top of that. It's not doing anything "new"

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

#89
post #5
post #2

This is pretty great. The biggest reason I hate doing android development is the java (and to a lesser extent, kotlin) "ecosystem" is a pain. Java is a sucky language to write; Kotlin is less bad, but the whole build tooling/package management/IDE mania mess is still a hassle to use. So thanks to the author.

I can tolerate Java and Kotlin, but the tooling is just awful *. I've stopped counting how many times I came back to an Android project after only a few months, only to have Android Studio force me to update Gradle and dependencies and whatnot, and break everything. * Of course one could blame me for not learning the ins and outs of the build system!

[deleted]

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

#90

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.

Getting Linux running is not the problem. All android phones have a working Linux kernel, and could probably be made to run some kind of Linux based software if you can get through the bootloader hurdles. The issues so far with open source phone stacks are largely around getting all the hardware talking with open source software, battery life, mobile appropriate UIs and finding ways to bring the apps people expect on…

[deleted]
Post reply on HN