HubbellCorp / SweetBlue

BLE on Android the easy way
Apache License 2.0
23 stars 8 forks source link

Feature Request: Custom shared preferences. #26

Open santaryan opened 1 year ago

santaryan commented 1 year ago

It would be nice to have the capability to pass in a custom SharedPreferences object as part of the BluetoothManager configuration. Rather than calling context.getSharedPreferences, the code would call a factory method supplied with the Config that would return a class implementing SharedPreferences. This would allow saving data into places other than the default Android shared preferences location, such as the new Encrypted Shared Preferences from Androidx Jetpack or a SQL database instead.

The factory method would ideally supply the application context associated with the manager as well as the namespace needed.