sd-card

How can I properly obtain the external SD card path?

假装没事ソ 提交于 2019-12-01 12:26:57
问题 I'm faced with the well-known problem of obtaining the path of an external SD card mounted on some Android devices. (see this question for understanding what I mean) I've thought to solve the problem by reading the content of /etc/vold.fstab , then taking just lines representing partitions, but I don't have a device for doing tests. What I want to do is to read that file, ignore the row which refers to the address returned by Environment.getExternalStorageDirectory() , and take the other row

Is it possible to save database file to SD card? [duplicate]

时间秒杀一切 提交于 2019-12-01 12:15:24
Possible Duplicate: Is it possible to copy database file to SD card? I have a database on my Android phone, and I need to get the information onto an SD card. Is it possible to save the database file onto the SD card in a readable state? I haven't been able to find any information on how to do this. I know the name of the database, and fields etc... I've found some examples that show how to save to SD cards, but not exactly what I need. Some source code that copies the database file to an SD card would be perfect. Hopefully this question is clear enough. Yes. Here is the function that i use:

Delete Audio From Sdcard

拈花ヽ惹草 提交于 2019-12-01 11:51:56
I'm trying to delete an audio file in the SD-card but I'm not successful public boolean delete(String path) { return new File(path).delete(); } While going through posts I came across Storage Access Framework but unable to understand. Is it required for deleting files from SD-card? Moreover Can I only use Content Resolver to delete Files Like this? getContenResolver().delete(uri,null,null); Or is there any other method for deleting Audio? My app is well elevated with Write permission and Read permission and I am testing on Marshmallow 6.0 Please answer. Thanks in advance. You need to ensure

Take Screenshot of Android screen and save to SD card

妖精的绣舞 提交于 2019-12-01 11:41:43
There are a few questions here on SO about capturing screenshots of an android application. However, I haven't found a solid solution on how to take a screenshot programatically using the android SDK or any other method. So I thought I would ask this question again in the hopes that I can find a good solution, hopefully one that will allow capturing full length images that I can save to the SD card or somewhere similar. I appreicate any help This is not possible directly on the device/emulator, unless it is rooted. to honest all I need it for is the emulator as this is for a testing

How to hide folder in sdcard programmatically in android

这一生的挚爱 提交于 2019-12-01 11:10:50
I have an app with xyz.zip folder which is extracting after installation in sdcard. Folder contains a lot of files(e.g Video,audio,etc.).During installing app I wanna hide that folder and hide all items of folder. Thanks in advance. Any answer is appreciated. Use a function like this: public static void hideFile(File file){ File dstFile = new File(file.getParent(), "." + file.getName()); file.renameTo(dstFile); } Please note I did not try the code, but it should at least give you the idea of how to do it. CommonGuy If you want to hide folder in Android or any Linux based system just add . as

Setting the Wallpaper from an Image on the SDCard

爷,独闯天下 提交于 2019-12-01 10:16:09
问题 How would one go about setting the homescreen wallpaper from an image on the SDcard? i.e.: try { wallpaperManager.setResource("/sdcard/wallpaper/olive.jpg"); finish(); } catch(IOException e) { e.printStackTrace(); } hasn't worked, returned an error: 'The method setResource(int) in the type WallpaperManager is not applicable for the arguments (String)' 回答1: Bitmap o = BitmapFactory.decodeFile("/sdcard/wallpapers/olive.jpg"); try { wallpaperManager.setBitmap(o); finish(); } catch (IOException e

Take Screenshot of Android screen and save to SD card

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 10:08:30
问题 There are a few questions here on SO about capturing screenshots of an android application. However, I haven't found a solid solution on how to take a screenshot programatically using the android SDK or any other method. So I thought I would ask this question again in the hopes that I can find a good solution, hopefully one that will allow capturing full length images that I can save to the SD card or somewhere similar. I appreicate any help 回答1: This is not possible directly on the device

How to create an SD Card image file for the Android emulator? [closed]

£可爱£侵袭症+ 提交于 2019-12-01 03:04:34
I need to create an SD Card image file for an Android emulator that I am running. Given that I am a beginner at Android development, a complete step-by-step tutorial would be awesome. Yury There is a command line program for doing that called mksdcard: https://developer.android.com/studio/command-line/mksdcard.html Samir Mangroliya There are already SD Card image files for use with the emulator installed. If you create an AVD then choose a file path for the SD Card on My Machine the file path is: C:\Users\Samir\.android\avd\Android2.2.avd\sdcard Then, click 'Ok' and save the changes, then this

Android: How to detect Dual sd-card [duplicate]

佐手、 提交于 2019-12-01 00:20:52
This question already has an answer here: Find location of removable SD card 21 answers Is there any way of identifying if there are two sd-cards in a device?? Edit: I have found that at the moment, there is no way of distinguishing between internal storage and true external SD card. In some devices like Samsung Galaxy Tab (7 inches), the system takes the internal storage (usually 16gb) to be as an external storage. Unfortunately there is no way to distinguish between internal storage and secondar/external/sd-card storage. If someone thinks it is possible (for honeycomb and previous versions),

Android: How to detect Dual sd-card [duplicate]

随声附和 提交于 2019-11-30 19:09:22
问题 This question already has answers here : Find location of a removable SD card (21 answers) Closed 4 years ago . Is there any way of identifying if there are two sd-cards in a device?? Edit: I have found that at the moment, there is no way of distinguishing between internal storage and true external SD card. In some devices like Samsung Galaxy Tab (7 inches), the system takes the internal storage (usually 16gb) to be as an external storage. Unfortunately there is no way to distinguish between