Remix.run Logo
zwnow 9 hours ago

Does this support native components like camera access and stuff like that? I've learned with most libs like this I never have access to the android internals (Flutter as an example) and I'll always have to fallback to writing Kotlin components with broadcast channels or whatever.

pjmlp 2 hours ago | parent | next [-]

That will always be the case, some folks cannot get over that Android userspace is Java/Koltin, and the NDK use cases are officially real time audio, 3D rendering, writing native methods, reuse of existing C and C++ libraries and nothing else.

Everything outside those use cases is gated behind JNI calls, and Google has no plans to ever change it.

Naturally many with GNU/Linux mindset, and because Android runs on the Linux kernel, try to work around these restrictions, however Google isn't going to move an inch to make it easier.

rekireki 9 hours ago | parent | prev [-]

It doesn't, and I had to write some Java to support clipboard.

zwnow 8 hours ago | parent [-]

I see, still a really cool project! Is accessing the internals simply not possible or just really hard to pull off programmatically? I am wondering about that because I never found anything in the android space to enable that without resorting to Kotlin/Java components.

nicoburns 7 hours ago | parent | next [-]

You can call into to the JVM via FFI (e.g. using the jni crate in Rust), but it's not very nice. And most of the abstractions people have written thus far seem to be primarily (or solely) targeting the "Java calls into native code" use case rather than the "native code calls into Java" use case.

I'd love to see something better here. I suspect it's possible.

rekireki 4 hours ago | parent | prev [-]

It's limited to what NativeActivity / GameActivity can provide. And as @nicoburns mentioned, you'll have to use FFI if you want to access some Android functionality. But it doesn't always go smooth. For example, all my attempts to fix issues with software keyboard didn't work.