Calling native libraries in Flutter using Platform Channels

后端 未结 3 1607
名媛妹妹
名媛妹妹 2020-12-05 03:42

Using platform channels, Flutter can interop with the native platform (i.e. reading battery level). On Android, this would require calling a Java method.

I\'d like t

3条回答
  •  醉话见心
    2020-12-05 04:02

    The Android side of flutter uses Gradle (the same as any other android project). If you have an existing android app, you can probably port over most of the same settings from your gradle files.

    Unless you've already done that and have a system for managing the jars, I would not recommend copying the jar files directly into your project & therefore source control.

    Instead, use gradle's build-in dependency resolution. You should be able to follow Amazon's android sdk set-up directions. The difference is that you'll have to hook up the calls to the SDK through method channels and write your own interop code.

提交回复
热议问题