huitingyeong / bluetooth_enable

MIT License
1 stars 36 forks source link

Upgrading to Android V2 embedding #8

Closed Alystrasz closed 2 years ago

Alystrasz commented 3 years ago

Upgrading both library and example app to use latest Flutter APIs. The idea is to fix #7.

MrCsabaToth commented 3 years ago

Thanks so much. I read through https://flutter.dev/docs/development/packages-and-plugins/plugin-api-migration but got stuck when BluetoothEnablePlugin needed to implement FlutterPlugin and ActivityAware because Android Studio IDE cannot import majoirty of the flutter specific package imports and I didn't have enough experience to do this blind.

Alystrasz commented 3 years ago

Yeah, this is the first time I migrate a plugin to V2, so I encountered same problems :smile: I tried to open the android folder as an Android project with Studio, but even with this, the IDE struggled to correctly import Flutter packages; I succeeded only thanks to the javadoc...

https://api.flutter.dev/javadoc/io/flutter/embedding/engine/plugins/FlutterPlugin.html https://api.flutter.dev/javadoc/io/flutter/embedding/engine/plugins/activity/ActivityAware.html

MrCsabaToth commented 3 years ago

I'm trying to convert https://pub.dev/packages/share_files_and_screenshot_widgets now. I figured that one way is to right click the android folder in the project tree in Android Studio and it has a menu to open up the Android part of the project only. That kicks off a gradle build. Than the gradelw files are missing for the plugin and the example as well. That can be generated by gradle wrapper command, however in my case I had extra difficulty that my Linux (Devuan) had a too old gradle. Interesting journey. I'm learning from your code now.

MrCsabaToth commented 3 years ago

@huitingyeong ?

Alystrasz commented 3 years ago

@huitingyeong are you willing to review this?

I currently have access to Apple hardware, so I'd like to continue working on your package by adding iOS support (https://github.com/Alystrasz/bluetooth_enable/tree/ios).

MrCsabaToth commented 2 years ago

Hey @Alystrasz what's the reason for the close? I'm directly depending on your fork in my yaml, so if you plan to take it down I ll fork it.

Alystrasz commented 2 years ago

Hello @MrCsabaToth, I cannot wait anymore for the author to accept the PR, so I decided to publish my own fork on the store: https://pub.dev/packages/bluetooth_enable_fork

If you need this feature in particular, I saved the repo state on this branch: https://github.com/Alystrasz/bluetooth_enable_fork/tree/chore/android-v2-embedding