Database access from Rust #5
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
It is possible to obtain a path which Rust can directly use to create and manage files, such as SQLite database files, with
Context.getDatabasePath(file name)
.A
MainActivity
has a context, so it's possible to callgetDatabasePath
directly. From within aComposable
, it is possible to access the context viaLocalContext.current
, although this shouldn't be necessary.The
sqlite
Rust crate seems run fine on Android.It is probably not worth to worry about the fact access to the database would be blocking at first. If it becomes a concern,
tokio::task::spawn_blocking
can probably be used to help alleviate the problem.