sd-card

Store Bitmap image to SD Card in Android

柔情痞子 提交于 2019-12-19 03:21:53
问题 I am facing some strange problem with my android code, I have an image in Bitmap variable and want to save that file to SD card. I code as follow, Bitmap IMAGE // Loaded from internet servers.; try { File _sdCard = Environment.getExternalStorageDirectory(); File _picDir = new File(_sdCard, "MyDirectory"); _picDir.mkdirs(); File _picFile = new File(_picDir, "MyImage.jpg"); FileOutputStream _fos = new FileOutputStream(_picFile); IMAGE.compress(Bitmap.CompressFormat.JPEG, 100, _fos); _fos.flush(

SD card files updated programmatically are not updated in windows explorer

会有一股神秘感。 提交于 2019-12-18 16:57:10
问题 My application does file operations on the SD card (delete or update file). But when I connect the device to Windows 7 through USB, I do not see any changes. However I can confirm files where updated or deleted with adb shell. I use an ASUS eee Pad with Android 3.0. It seems devices running Android 3.0 have a different way to provide access to the file system (MTP instead of USB Mass Storage). I also read about how we can use MediaScannerConnection.scanFile to refresh the content of Windows

Any way to send commands to SD card from Linux userspace?

时光怂恿深爱的人放手 提交于 2019-12-18 16:52:21
问题 I have a Debian 7.0 Linux 3.2 embedded ARM TI AM335x system. This is a custom board we've developed, but the SD card section at least is the same as the development board. There are some vendor-specific SD card commands I'd like to issue to the card, namely reading some SMART data using CMD56. Is there any way to send commands to the SD card controller and read the response from userspace? 回答1: Your driver is omap_hsmmc according to http://processors.wiki.ti.com/index.php/AM335x_MMC/SD_Driver

How can I use Intent.ACTION_VIEW to view the contents of a folder?

孤街浪徒 提交于 2019-12-18 13:32:22
问题 I'm trying to view the images in a specific folder using an intent. My code is as follows: Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); Uri imgUri = Uri.parse("file://sdcard/download"); intent.setDataAndType(imgUri, "image/*"); startActivity(intent); However, each time it runs, I get this message in the log: 02-25 00:40:16.271: ERROR/(8359): can't open '/download' 02-25 00:40:16.271: ERROR/(8359): can't open '/download' What am I doing wrong? 回答1: I think this is far

WebView Cache Data Directory?

不想你离开。 提交于 2019-12-18 12:42:59
问题 In my code I have a custom cache directory set to the sdCard and I point the 'WebView.getSettings().setAppCachePath("")' to this path but the OS sends the cache to the default cache (/data/data/com.your.package.appname/cache). The custom directory is being created correctly where it should be, but the data doesn't get into it. The reason I am using a custom directory is the cache's will be large and temporary so I need the user to be able to delete specific caches. Am I missing something here

saving gif file from drawable into phone sd? and remove it from sd after usage

£可爱£侵袭症+ 提交于 2019-12-18 09:43:23
问题 I have been searching on how to save file from Drawable into sd card OR phone's internal storage. All examples such as this one showed only for PNG type, I want to get GIF file from my drawable and save it into phone sd, and later remove it from sd after usage. Anybody please help with the code? I appreciate it! 回答1: As far as i know there isn't such a native function on Android (maybe related to patent issues). You may try this library for your purpose. Usually its meant to create animated

Stream android logcat output to an sd card

落花浮王杯 提交于 2019-12-18 05:00:14
问题 I want to achieve the following but so far, no luck Open a file in the SD Card when the android application first started. Stream the logcat output to the file. When the application exits, stop the logcat streaming. In my ApplicationClass extends Application onCreate() method, I do this wwLogManager.openLogFile(); and here's the code in the openLogFile() private static final String LOGCAT_COMMAND = "logcat -v time -f "; String timestamp = Long.toString(System.currentTimeMillis()); String

where is my app? /data appears empty

心已入冬 提交于 2019-12-18 04:21:51
问题 I almost feel embarrased asking this but I really can't find my app on my phone. I read that the app should be installed in /data/data/ folder but my /data folder appears to be empty when viewed in Astro. My app is most definitely installed on the phone, should I transfer it to the SD for it to become visible? I have an unrooted HTC Desire HD on Orange UK. I just need to have a peek at the SQLite database managed by my App. 回答1: I almost feel embarrased asking this but I really can't find my

How can I backup sqlite file in SD Card programmatically?

落花浮王杯 提交于 2019-12-18 03:47:48
问题 When you use emulator your sqlite file is stored in a folder near your main application folder and you can download it. But this feature is not accessible in not rooted devices. How can I backup this existing sqlite file in SD Card programmatically ? I want to have a button in my application that stores this file in a special path in my SD Card. Is it possible? Thanks, 回答1: You can try this, work for me, remember to get the WRITE_EXTERNAL_STORAGE permission in your manifest: // Copy to sdcard

How does storage access change on Android 6?

二次信任 提交于 2019-12-17 22:05:15
问题 Background Android had a lot of changes as to how to handle the SD-card and storage in general: API 3 - you get all access, no permission needed API 4-15 - you need to use WRITE_EXTERNAL_STORAGE, and you get all access. API 16-18 - if you wish only to read, use READ_EXTERNAL_STORAGE API 19-20 - you can't read or write to secondary external storage (SD-card), unless your app is a system app, or you have root. API 21-22 - in order to access the SD-card, you need to ask the user for permission,