Link Rust Library to Android Application Codebase
Is your feature request related to a problem? Please describe
Currently, our rust library isn't linked to the application codebase, and application bears references of functions from the library and the library itself, as a result of which it crashes each time it is launched. By far we've been using some hacks to not initialize the library and just set the application build green and fix UI components. But now we wish to implement a robust and permanent fix that'll remove all the crashes that may occur due to incorrect lib referencing or linking.
Describe the solution you'd like
Currently the problem which is encountered in library linking is that it fails to properly access/create a directory in android device to save state, and fails due to presence of lesser privileges, it fails to do so. Also, it turns out that the crate(xdg-rs/dirs) we're using for saving state across different platforms doesn't provide explicit support for Android(see platforms). I also filed an issue there(see xdg-rs/dirs/issues/54) regarding the same but it went un-responded. Anyways, we fixed the problem internally at my local fork and hopefully will push the fix after cleaning up and optimizations.
The solution is to write a custom implementation for finding the private storage of the application in the device(which exists by virtue of being an android application in android devices and is app-specific, learn more about it here) and use it for storing state. Also we'll need to refactor the FFI Layer as well after the changes being made in application's package name.
Describe alternatives you've considered
- Writing Custom impl for finding home(as xdg-rs does it incorrectly)
- modifying + extending the FFI Layer in accordance with application codebase.
- Adding
android-support
crate to our workspace to make it part of CI runs and track if it breaks at some point.
Additional context
NA