sd-card

How to Reuse getExternalStorageState?

时光毁灭记忆、已成空白 提交于 2019-11-27 08:33:18
问题 How can this be written in its own class to be used over and over again? And where the comment line "//Loads the List" is, I need to be able to change that at runtime. Thnx ahead of time for the info. /** * -- Check to See if the SD Card is Mounted & Loads the Ordered List * ====================================================================== **/ private void storageState() { if (android.os.Environment.getExternalStorageState().equals( android.os.Environment.MEDIA_MOUNTED)) { orderASC();//

Android : Saving Files to SD Card

狂风中的少年 提交于 2019-11-27 08:09:38
问题 I am trying to save a file out from within my app to the external storage of a device. Specifically, I am trying to save a sound out. I've followed every 'tutorial' on doing this, and none of it seemed particularly confusing to me, yet it just will not work for me. No file is ever created on the SD card at all, much less actually transferring over the information. I've assumed I am somehow not getting the correct path to the card, but no matter what I have tried it doesn't work. I have tried

It is possible to get total storage capacity?

﹥>﹥吖頭↗ 提交于 2019-11-27 06:16:00
问题 i know how to get free capacity on internal memory and on external storage. But i want to know max capacity of internal memory and max capacity of external storage, but i can't find any info about it on google it is possible to achieve it? thanks 回答1: Some new methods were introduced in API 18. This is the code I used to get total storage (internal + external). private static final long KILOBYTE = 1024; StatFs internalStatFs = new StatFs( Environment.getRootDirectory().getAbsolutePath() );

Android: Save file permanently (even after clear data / uninstall)

删除回忆录丶 提交于 2019-11-27 05:20:51
I would like to know if there is a way to store a small amount of data permanently. By permanently I mean I want the data to persist even if user clears app data / uninstalls app. I know that shared preferences and databases are deleted when user clears app data / uninstalls app. I also know that I can save stuff on SD Card, but what if device does not have SD Card / SD Card is unmounted? I think that the best option would be to save the data on device internal memory, but is it possible to do that without getting the data deleted when clears app data / uninstalls app? You shouldn't do that,

(re)mounting the SD card on android emulator

青春壹個敷衍的年華 提交于 2019-11-27 04:41:59
问题 On the emulator, I can unmount the SD card from the Settings. I can then mount it on my OS, then unmount it normally. I haven't been able to figure out how to re-mount it then on the emulator (without rebooting it). hints: the adb command remount is unrelated: it's about /system the emulator command is unrelated: it's only about starting the emulator mounting the SD card in two places of course messing everything up (I tried) more: mount outputs the following: /dev/block//vold/179:0 /sdcard

Getting all the total and available space on Android

 ̄綄美尐妖づ 提交于 2019-11-27 04:32:52
To my knowledge, on Android, there is: Internal memory for apps and cache Internal SD Card on some phones (not removable) External SD Card for music and photos (removable) How do I get the total and available for each with a check that they exist (some phones do not have an internal SD Card) Thanks Here is how you get internal storage sizes: StatFs statFs = new StatFs(Environment.getRootDirectory().getAbsolutePath()); long blockSize = statFs.getBlockSize(); long totalSize = statFs.getBlockCount()*blockSize; long availableSize = statFs.getAvailableBlocks()*blockSize; long freeSize = statFs

How to capture the image and save it in sd card

白昼怎懂夜的黑 提交于 2019-11-27 03:00:49
问题 hey guys i am using the following code to access camera from my application. The application is able to access the camera i have also added a button whose onclicklistener adds this line of code :- camera.takePicture(mShutterCallback, mPictureCallbackRaw, mPictureCallbackJpeg); Now i dont know what happens but the application gets stuck i have to force close it and then i can not even access the native camera application. I think it leaves the application without releasing the Camera object.

External SDCard file path for Android

天大地大妈咪最大 提交于 2019-11-27 02:17:58
问题 Is it true that the file path to external SDCard on Android devices are always "/storage/extSdCard" ? If not, how many variations are there? I need it for my App to test the availability of external SDCard. I am using Titanium, it has a method Titanium.Filesystem.isExternalStoragePresent( ) but it always return true even external SDCard is not mounted. I think it detect SDCard at local storage thus return true. But what I really want is detect whether physical SDCard is mounted or not. Can I

getExternalStorageDirectory not working

不问归期 提交于 2019-11-27 02:07:14
问题 I am trying to save a file to my SDcard on my Samsung Galaxy Nexus running 4.2.2. From my app I am using Environment.getExternalStorageDirectory() But it returns /storage/emulated/0/ Which is not where my SDcard information is located to. Is there any working method I can use to get the correct path to my SDcard? 回答1: Actually, that is the correct location. From android 4,2 onwards, Google introduced multiple user accounts. Every user has his/her own external storage, which has the user ID in

Is it possible to move the internal DB to the SDCard?

半世苍凉 提交于 2019-11-27 01:42:00
问题 As the database in my app grows, it is going to require more and more of the internal phone space. There isn't any sensitive/private data in the DB, so I'm interested in moving it to the SD card. I'm using SQLiteOpenHelper to assist with the database work. It's my understanding that you can't use this for DB-access on the SD card as you can't define the DB path. However, there are some (very poor) examples on the Internet that suggest you can override this limitation. However I've never