AlanScottAgain 1 Posted May 14, 2023 Hi Is there an equivalent to TPath.GetHomePath for the obb directory? I want to deploy some video files in an APK expansion pack. But not sure how to find where they will be installed to. Thanks Alan Share this post Link to post
programmerdelphi2k 237 Posted May 14, 2023 (edited) see on https://developer.android.com/google/play/expansion-files The getObbDir() method returns the specific location for your expansion files in the following form: <shared-storage>/Android/obb/<package-name>/ by Android Developers pages: https://developer.android.com/training/data-storage/shared/documents-files Quote Access restrictions On Android 11 (API level 30) and higher, you cannot use the ACTION_OPEN_DOCUMENT/ACTION_OPEN_DOCUMENT_TREE intent action to request that the user select individual files from the following directories: The Android/data/ directory and all subdirectories. The Android/obb/ directory and all subdirectories. maybe some like this (need test it in your environment) function GetObbDir: string; var AppContext: JContext; ObbDir : JFile; begin AppContext := TAndroidHelper.Context; // SharedActivityContext; // TJNativeActivity.Wrap(System.DelphiActivity); ObbDir := AppContext.GetObbDir; { Delphi11 } // before... // ObbDir := TJContextCompat.JavaClass.GetObbDir(AppContext); Result := JStringToString(ObbDir.GetAbsolutePath); end; tested in Android11 + Delphi11 file:///storage/emulated/0/Android/obb/com.embarcadero.Project1 Edited May 14, 2023 by programmerdelphi2k Share this post Link to post