android-external-storage

Android 10: What are my options to save files on external storage into a directory called “/sdcard/my-app/”

旧巷老猫 提交于 2020-07-31 07:28:52
问题 Up until Android Pie I always stored files which the app needed to get stored on /sdcard/my-app/ , which I got via File fBaseDir = new File(Environment.getExternalStorageDirectory(), "my-app"); One of my App stores hundreds (up to multiple thousands) of favicons in /sdcard/my-app/favicons , and when the user creates a backup of the app, it gets stored in /sdcard/my-app/backups . Webpage-Screenshots taken by Google Chrome when shared with my app are stored in /sdcard/my-app/screenshots , and

Saving Files in Android - For Beginners (Internal / External Storage)

与世无争的帅哥 提交于 2020-07-18 05:52:31
问题 I'm very new to android development and I need a beginners help please... I am creating an app that should have 2 directories, a Databases directory and an Images directory, just like Whatsapp has. I want to see those directories in the File Manager when I'm browsing my phone, just like you see other apps folders. I tried everything I found here, to create it in the Internal storage and in the External storage from code. The folders seem to be created, but when I browsed my phone's File

Media scanner for secondary storage on Android Q

狂风中的少年 提交于 2020-07-04 06:45:29
问题 With the newer Android Q many things changed, especially with scoped storage and gradual deprecation of file:/// URIs. The problem is the lack of documentation on how to handle media files correctly on Android Q devices. I have a media file (audio) management application and I could not find yet a reliable way to tell to the OS that I performed a change to a file so that it can update its MediaStore record. Option #1: MediaScannerService MediaScannerConnection.scanFile(context, new String[]{

Android Things filesystem

北城以北 提交于 2020-01-13 20:43:09
问题 I am building this app on android things. I want to be able to give it access to media files on a USB stick or maybe even the raspberry pi's SDcard. I don't know what I'll have it do with those files yet but I just wanna know if its possible. If it isn't that's fine I have other solutions but I figured I would start with the obvious approach first. 回答1: I'm didn't try it, but seems it's possible by the same way as in normal Android OS. To do this You should mount Your USB dongle into the

Force access to external removable microSD card

假如想象 提交于 2020-01-12 03:27:30
问题 I'm using a Samsung A3, Android 5.0.2. I'm using this setup to compile apps, i.e. Android 4.1 Jelly Bean (API 16) target. I precisely know the path of the external removable microSD card, it is /mnt/extSdCard/ (see also Note #7 below). Problem: I notice that File myDir = new File("/mnt/extSdCard/test"); myDir.mkdirs(); doesn't work: no directory is created. Also: File file = new File("/mnt/extSdCard/books/test.txt"); // the folder "books" already exists on the external microSD card, has been