sd-card

FATFS can't initialize the SD card

霸气de小男生 提交于 2020-06-03 17:24:32
问题 So I'm using an STM32F407 and trying to write to an SD card with FATFS. I have used the CubeMX to generate the code for both the FAT layer and 4bit SDIO configuration software. I have added the following code to main to test whether the code works. UINT bw; f_mount(&FatFs, "", 0); /* Give a work area to the default drive */ /* Create a file */ if(f_open(&Fil, "newfile.txt", FA_WRITE | FA_CREATE_ALWAYS) == FR_OK) { f_write(&Fil, "It works!\r\n", 11, &bw); /* Write data to the file */ f_close(

FATFS can't initialize the SD card

给你一囗甜甜゛ 提交于 2020-06-03 17:24:23
问题 So I'm using an STM32F407 and trying to write to an SD card with FATFS. I have used the CubeMX to generate the code for both the FAT layer and 4bit SDIO configuration software. I have added the following code to main to test whether the code works. UINT bw; f_mount(&FatFs, "", 0); /* Give a work area to the default drive */ /* Create a file */ if(f_open(&Fil, "newfile.txt", FA_WRITE | FA_CREATE_ALWAYS) == FR_OK) { f_write(&Fil, "It works!\r\n", 11, &bw); /* Write data to the file */ f_close(

Open file picker form my Android activity

与世无争的帅哥 提交于 2020-05-11 14:29:48
问题 I'm making an Android app which stores some downloaded pdf files inside the device's SD card. Everything works fine, but now I want to add a function to just pop up the default android file/folder browser showing the directory where my app stores all the PDF (with subdirectories in it) so that the user sees where his documents are stored and can easily browse them. I've been throught many other SO questions and forum posts, but it seems this can only be done for music/images/contacts/etc.

access denied error from WriteFile to physical disk, win7

时间秒杀一切 提交于 2020-01-30 12:25:26
问题 I am trying to write some data to an SD card from a specific physical sector. I received a code to do this from a company and they say it works ok on windows-xp. This is the same case with WriteFile error #5 "denied access" under win Vista/seven Here is the part writing the data to SD card (in my cae drv value is 'F'). Reading from others, I added locking and dismont but the lock fails (and dismount too). I'm not so familiar with windows programming. Can anybody tell me what's wrong in this

Convert View to bitmap FileNotFoundException problem

半腔热情 提交于 2020-01-25 21:10:48
问题 I'm trying to convert my LinearLayout to a bitmap so that I can save the current layout content as an image in SD card. First, I create bitmap and canvas and attach the layout to the canvas. Followed steps from http://www.brighthub.com/mobile/google-android/articles/30676.aspx#comments. //code to add child view into layout before creating bitmap screenBitmap = Bitmap.createBitmap(200,200,Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(screenBitmap); layout.draw(canvas); When I press the

creating a drawable from sd card to set as a background in android

半世苍凉 提交于 2020-01-21 03:46:27
问题 I am trying to use an image from the sd card and set it as the background for a relativelayout. I have tried other solutions that i have found here and elsewhere but they havent seemed to work for me. here is my code. I have commented out other ways that i have tried and didnt work. the only thing that worked for me was using setBackgroudnResource and using a resource from the app, but this was just to test to make sure mRoot was set up correctly. when I have tried all the other ways, it just

creating a drawable from sd card to set as a background in android

眉间皱痕 提交于 2020-01-21 03:46:07
问题 I am trying to use an image from the sd card and set it as the background for a relativelayout. I have tried other solutions that i have found here and elsewhere but they havent seemed to work for me. here is my code. I have commented out other ways that i have tried and didnt work. the only thing that worked for me was using setBackgroudnResource and using a resource from the app, but this was just to test to make sure mRoot was set up correctly. when I have tried all the other ways, it just

android access folder using environment.getexternalstoragedirectory on device with only internal memory would return?

落爺英雄遲暮 提交于 2020-01-16 13:20:35
问题 im using this code to access a folder: String path = Environment.getExternalStorageDirectory().getAbsolutePath()+ "/somefolder"; on devices with sdcard this is ok, i don't have a device with only internal memory to test what happens, what would happen if this is executed on a device without sdcard? will it automatically set to the internal memory path? the user of the app would put this folder in the root of the available memory. is there a way to get internal path? is there a way to check

How can I load a sound from the SD Card insted of the raw folder in my Android app useing Soundpool?

て烟熏妆下的殇ゞ 提交于 2020-01-14 04:24:07
问题 I am useing this example to load and play sounds in my Androidapp. I am adding new sounds with mSoundManager.addSound(2, R.raw.sound1); . How can I load a sound from the SD Card insted of the raw folder in my app? 回答1: Have a look at this: http://developer.android.com/reference/android/os/Environment.html#getExternalStorageState() 来源: https://stackoverflow.com/questions/4293122/how-can-i-load-a-sound-from-the-sd-card-insted-of-the-raw-folder-in-my-android-a

Issue with reading file on Windows Phone 8 SD card

和自甴很熟 提交于 2020-01-13 12:12:11
问题 I have problems reads the file on Windows Phone SD card. I get the valid Stream object using ExternalStorageFile.OpenForReadAsync. However any seek operation is ignored and position is not moved although the stream CanSeek property is true; private async void ReadFileOnSDCard(ExternalStorageFile file) { Stream stream = await file.OpenForReadAsync(); using (stream) { long curPos= stream.Seek(100, SeekOrigin.Begin); long pos = stream.Position; // both curPos and pos are 0. 回答1: I was fighting