Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 709
Joel Avatar asked Nov 29 '16 16:11

Joel


1 Answers

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.

like image 183
Eric Seidel Avatar answered Oct 18 '22 01:10

Eric Seidel