Flutter build with C/C++ code - example?

3,730

We do not currently have an example of doing such. To make C++ interop easy, we would want to provide a C API for the HostMessages system, which we do not currently have.

You filed a bug to request such( https://github.com/flutter/flutter/issues/7053) which I have updated with this request.

Share:
3,730
Joel
Author by

Joel

Updated on December 01, 2022

Comments

  • Joel
    Joel over 1 year

    I'm using the hello_services gradle build to create a service in Java, but what I would really like is to use C/C++ code within my app, initially on Android. I've tried integrating some C code with no success (I end up messing up the flutter build).

    I'm looking for an example or information on how to add that in. Ideally, I'd like to call Dart/Flutter flutterView.sendToFlutter() from C code, but JNI works fine as well.

    I'm guessing I can add a gradle subproject, any tips/pointers appreciated.