So I have a library that drives external devices over bluetooth or wifi. The library was written by another party and I cant really change it.
There will be multiple android applications controlling the device. Separate APKs and separate processes. The act of connecting/reconnecting cant be done when the user switches apps. So my thinking is to basically wrap the library in a service that runs in its own process and the client applications can bind to that.
This presents a few interesting problems. The data objects in the library are not Parcelable or Serializable. There are not that many but they support generics and wrapping them all would be very time consuming.
There are also a few dozen objects which basically represent interfaces for controlling specific aspects of the device each with 2-12 methods each. Maybe I could wrap each of these using AIDL.
I want to make using the service as similar to using the library directly as possible.
I feel like wrapping a third party library as an AIDL service is probably not all that uncommon for Android developers. Does any one who has faced this before have any suggestions?