How to use Java library in flutter?

455 views
Skip to first unread message

Ben-Ron Geldenhuys

unread,
Mar 13, 2019, 4:23:03 AM3/13/19
to Flutter Dev

Hi guys, I have a android(Java) library that I created in android studio. I need to use the functionality in a Flutter project.

Please can you help me by explaining how to actually use the library in my Flutter project?
The Library just have a few methods that takes params and returns values based on an API call inside the Library.

Steven McDowall

unread,
Mar 13, 2019, 6:51:45 AM3/13/19
to Ben-Ron Geldenhuys, Flutter Dev
Not sure this is a lot of help -- but take a look at almost any Flutter plugin that interacts with the beackend OS os any sort .. (shared_preferences for example) and look in the android area and min lib/dart.  You will see CHANNEL methods that interact between the Dart and Java side on Android .. this is basically the same idea .. 

You'd write a wrapper around the Java functions to use the Channel stuff and a Dart side to use that.

I think Flutter has a basic create plugin that sets up the basic infrastructure ... 



--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages