sd-card

WARNING: File.mkdir() is ignored

∥☆過路亽.° 提交于 2019-11-30 18:27:38
I've created a basic Audio Recording App using Media Recorder API's. I'm trying to create a folder in the SD card and to save my recorded files to that folder. I'm getting this warning with following code. File.mkdir() is ignored // Assign random number to avoid audio file from overwriting Long tsLong = System.currentTimeMillis()/1000; // Specify a Location for the recorded file to be stored in the SD card mFileName = Environment.getExternalStorageDirectory().getAbsolutePath() + "/AudioRecordTest/"; File path = new File(mFileName); if(!path.exists()) { path.mkdir(); } mFileName += "

android: how can get full path of a file stored in a folder in sdcard?

那年仲夏 提交于 2019-11-30 17:04:24
I am working in android. i want to get the full path of a file selected by user. my files are stored in sdcard. but may be in a folder in sd card. I have some folders in my sdcard. I want to get the full path of a file on which i click. Suppose I have an image peacock.png in folder image/birds. So the path is mnt/sdcard/image/birds/peacock.png Please suggest me how can i get the full path of a file. If you need my code which i am using for help then tell me i will send it here. Thank you in advance. Here's a code snippet from this tutorial, that shows the pick file Intent implementation:

store an image in internal storage in android

回眸只為那壹抹淺笑 提交于 2019-11-30 16:56:00
I am working now on application that start the camera and take a photo, I didn't use camera activity, but I wrote my camera app and I want to save the taken image in the internal phone storage in folder called "temPic" The following code generate the folder and the image, but when I checked the tempPic I found an image called image1.jpg and it's size is 461115 ( I tried to store the image in SDcard directory and it is the same size), but when I double clicked it a black image appeared, not the taken one although in SDcard I opened it !!! FileManipulator fileFormat = new FileManipulator(

store an image in internal storage in android

為{幸葍}努か 提交于 2019-11-30 16:18:50
问题 I am working now on application that start the camera and take a photo, I didn't use camera activity, but I wrote my camera app and I want to save the taken image in the internal phone storage in folder called "temPic" The following code generate the folder and the image, but when I checked the tempPic I found an image called image1.jpg and it's size is 461115 ( I tried to store the image in SDcard directory and it is the same size), but when I double clicked it a black image appeared, not

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

こ雲淡風輕ζ 提交于 2019-11-30 15:55:10
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 doesn't set anything. Anyone know what I am doing wrong, or if there is a better way to do this? //one

How can I use an SD card for logging 16-bit data at 48 ksamples/s?

亡梦爱人 提交于 2019-11-30 11:24:41
Background My board incorporates an STM32 microcontroller with an SD/MMC card on SPI and samples analogue data at 48 ksamples/s. I am using the Keil Real-time Library RTX kernel, and ELM FatFs . I have a high priority task that captures analogue data via DMA in blocks of 40 samples (40 x 16 bit); the data is passed via a queue of length 128 (which constitutes about 107 ms of sample buffering) to a second low priority task that collates sample blocks into a 2560 byte buffer (this being a multiple of both the 512 byte SD sector size and the 40 sample block size). when this buffer is full (32

Android - Storing images downloaded from the web

跟風遠走 提交于 2019-11-30 10:18:04
问题 I had a question related to whether or not (and how) I should store images loaded from the web. Let's say I am calling a web service from my Android app. In this web service I get a URL for an image on the web. I download and show this image on the left side of a list item in a ListView. My question is, what method should I use for possibly storing the image? Should I: Save it to the SDCard, checking if it exists when the ListView is created (on subsequent requests) and re-downloading as

WebView Cache Data Directory?

回眸只為那壹抹淺笑 提交于 2019-11-30 07:46:27
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? Any help, code, or suggestions will be appreciated as always. Thank-you. public class DocumentView

Permission to write on SD card android

戏子无情 提交于 2019-11-30 07:37:59
I have a problem writing to the SD card, here is the code: (Sorry about the layout of the code, just copy pased it ) public class SaveAndReadManager { private String result; private String saveFileName = "eventlist_savefile"; public String writeToFile( ArrayList<Event> arrlEvents ){ FileOutputStream fos = null; ObjectOutputStream out = null; try{ File root = Environment.getExternalStorageDirectory(); if( root.canWrite() ){ fos = new FileOutputStream( saveFileName ); out = new ObjectOutputStream( fos ); out.writeObject( arrlEvents ); result = "File written"; out.close(); }else{ result = "file

WARNING: File.mkdir() is ignored

江枫思渺然 提交于 2019-11-30 02:50:30
问题 I've created a basic Audio Recording App using Media Recorder API's. I'm trying to create a folder in the SD card and to save my recorded files to that folder. I'm getting this warning with following code. File.mkdir() is ignored // Assign random number to avoid audio file from overwriting Long tsLong = System.currentTimeMillis()/1000; // Specify a Location for the recorded file to be stored in the SD card mFileName = Environment.getExternalStorageDirectory().getAbsolutePath() + "