Class MetaStorageManager

java.lang.Object
net_62v.external.MetaStorageManager

public final class MetaStorageManager extends Object
Mundo storage manager, you can use the storage related api by using this class.
Version:
1.2
Author:
king@62v.net
See Also:
  • Constructor Details

    • MetaStorageManager

      public MetaStorageManager()
  • Method Details

    • obtainAppDataDir

      public static File obtainAppDataDir(String packageName, String splitRegion)
      Get the application data dir
      You must specific the package name and user name.
      Parameters:
      packageName - package name of the app
      splitRegion - user name
      Returns:
      data dir
      See Also:
    • obtainAppDataDir

      public static File obtainAppDataDir(String packageName, int splitRegion)
      Alias of the function obtainAppDataDir
      Parameters:
      packageName - package name
      splitRegion - user name
      Returns:
      data dir
      See Also:
    • obtainAppExternalStorageDir

      public static String obtainAppExternalStorageDir(String appPkg) throws RemoteException
      Obtain an external relative (not absolutely path) path by package name
      The path will mostly like to be /storage/emulated/0/Android/obb/[Your Package Name]/scopedStorage/[appPkg]
      Parameters:
      appPkg - package name
      Returns:
      A relative path, please do not hardcode the external path.
      Throws:
      RemoteException
      See Also:
    • setExternalRootDirectory

      @Deprecated public static boolean setExternalRootDirectory(String newRoot) throws RemoteException
      Deprecated.
      Please use the default configuration to evade the read and write issues above Android 11.
      Set the external directory root, and the external file structures will be [Your new external storage root dir]/[appPkg]
      If you change this path manually after an app upgrade, you must delete or move the origin dir manually.
      You must call this function before you launch the app, the application that already launched will continue to use the old path.
      Parameters:
      newRoot - New external storage root directory, which must be writeable File.canWrite().
      Returns:
      If the changes be applied successfully then true, otherwise false
      Throws:
      RemoteException
      Since:
      1.2
      See Also: