ralismark / bluehid

Bluetooth HID device for Android Oreo (proof of concept)
Apache License 2.0
36 stars 9 forks source link

Trying to convert the app to a aar library for use in unity #7

Open TheBricktop opened 3 years ago

TheBricktop commented 3 years ago

Hello ive found that this is one of the few working bluetoothhidprofile examples that actually work, im currently trying to strip it from any ui and just leave few functions to call from within the unity app. Im currently having some issues with mBtHidDevice.registerApp as im not that well familiar with threading logic in android. Does the class name need to be MainActivity for the bluetooth to work? Should i provide unityActivityContext to app registering for it to work properly?

ralismark commented 3 years ago

If you're targeting Android P or higher, have a look at the android-p branch. It's been a while since I've done any Android programming, so I'm not familiar with threading either. To answer your questions:

  1. I'm pretty sure any class name is ok
  2. Possibly? If there are any places which require an activity context then pass unityActivityContext to it.