jpnurmi / flutter_libserialport

Serial Port for Flutter
https://pub.dev/packages/flutter_libserialport
MIT License
139 stars 80 forks source link

Any plans to support Android? #76

Open Levi-Lesches opened 1 year ago

Levi-Lesches commented 1 year ago

The Android docs say to explicitly request permission before trying to use Serial functionality. Unfortunately, this is not something that can be done in the Manifest but must be done using Java/Kotlin, like package:usb_serial does.

Are there any plans to support that here?

magnus-lpa commented 11 months ago

Is there any way to do it manually?

Levi-Lesches commented 11 months ago

You would need to add a new method to the Android method channel, by adding an else-if right here: https://github.com/jpnurmi/flutter_libserialport/blob/e9c1fd940d26b2fc1674d5cb724027245c0ed094/android/src/main/kotlin/org/sigrok/flutter_libserialport/FlutterLibserialportPlugin.kt#L25-L31

and then call that method on the Dart side by following the instructions here

If you get that working, maybe consider submitting a PR?

magnus-lpa commented 10 months ago

@Levi-Lesches Thanks, I ended up using the usb_serial plugin instead. Just a note to others thinking of doing the same - that plugin also doesn't support the Android permission handling correctly with the current version on pub.dev, but with the latest commit (c20e1e6e171137db4b52413dac14333653f07905) from Github it does.

guyluz11 commented 4 months ago

The Android docs say to explicitly request permission before trying to use Serial functionality. Unfortunately, this is not something that can be done in the Manifest but must be done using Java/Kotlin, like package:usb_serial does.

Are there any plans to support that here?

Did it worked for you?. If so it will be nice if you can you add a pr for that and tag this issue. usb_serial only supports Android and I prefer a package that can support multiple platforms like this one.

Levi-Lesches commented 4 months ago

Turned out my use-case of serial on Android wasn't so strong so I dropped it for now, but I would like to see this implemented here as well.