android-rs-glue icon indicating copy to clipboard operation
android-rs-glue copied to clipboard

Can I create a normal android application in Rust with this library?

Open jjmornim opened this issue 9 years ago • 3 comments

In the "examples" the example is very simple. Can I create a normal android application in Rust with this library? Activities, toasts and so on?

jjmornim avatar Apr 18 '16 22:04 jjmornim

This library is meant for applications that do all the drawing and events handling themselves.

The package will contain only one activity, that is automatically generated by the library. The activity calls (indirectly) the main() function of your program. And that's it. The program is then responsible for drawing everything with an OpenGL or Vulkan context.

tomaka avatar Apr 19 '16 05:04 tomaka

That is a good description that probably should go in the readme.

ctaggart avatar Apr 28 '16 15:04 ctaggart

The application type android-rs-glue creates is so-called native activity, which is actually a special case in Android Framework, created precisely for games and other applications which do use not the framework (heavily) but the low-level features like OpenGL, sound, calculations etc. Native activity is really a rare exception of (mostly but not fully) C API in the framework, which is Java API-based. Writing framework applications in everything except Java means duplicating all the Java API in the target language, with the bindings to the original API through JNI. This is a huge work. You can check an example of it for Golang here.

snuk182 avatar May 03 '17 15:05 snuk182