tauri-plugin-android-fs 28.3.0

Android file system API for Tauri.
Documentation

Note: I’m using a translation tool, so some expressions may be awkward or inaccurate.

Overview

This plugin provides a unified file system API across all Android versions supported by Tauri.

By default (with default features enabled), this plugin does not add permissions to the application or enable any options that require additional review by Google Play.

NOTE: This page explains how to use this plugin in the Rust backend. For JavaScript bindings in the frontend, see tauri-plugin-android-fs-api on npm.

Setup

Register this plugin in your Tauri project:

src-tauri/src/lib.rs

#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
    tauri::Builder::default()
        .plugin(tauri_plugin_android_fs::init()) // This
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

Usage

In many cases, this plugin operates on files and directories using URIs instead of file paths. These URIs are represented as tauri_plugin_android_fs::FsUri.

The plugin provides the following APIs:

API Description
AndroidFs Provides core file and directory operations, such as metadata retrieval and reading and writing files.
Picker Provides file selection, directory selection, save dialogs, and permission management for selected entries.
Opener Provides opening files and directories in other applications.
PublicStorage Provides access to public directories accessible to other applications and users.
PrivateStorage Provides access to app-specific private directories.
AppStorage Provides access to directories used by the app. Compared with PrivateStorage, it provides additional functionality, but the directories may be more easily accessible to other applications.

For documentation and examples, see the API links above.

License

This project is licensed under either of

  • MIT license
  • Apache License (Version 2.0)

at your option.