sd-card

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

亡梦爱人 提交于 2019-12-28 02:11:19
问题 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

Getting all the total and available space on Android

余生颓废 提交于 2019-12-28 02:07:31
问题 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 回答1: Here is how you get internal storage sizes: StatFs statFs = new StatFs(Environment.getRootDirectory().getAbsolutePath()); long blockSize = statFs.getBlockSize(); long totalSize = statFs

How can I get the size of a folder on SD card in Android?

风格不统一 提交于 2019-12-27 20:07:09
问题 Is it possible to easily get the size of a folder on the SD card? I use a folder for caching of images, and would like to present the total size of all cached images. Is there a way to this other than iterating over each file? They all reside inside the same folder? 回答1: Just go through all files and sum the length of them: /** * Return the size of a directory in bytes */ private static long dirSize(File dir) { if (dir.exists()) { long result = 0; File[] fileList = dir.listFiles(); for(int i

Android - Application (apk) Maximum size

孤街醉人 提交于 2019-12-27 10:54:11
问题 I am going to install first application in my android phone, but having some doubts related to Android Memory (Maximum size of APK). So please help me know and solve the problems: What is maximum size of the apk that can be supported by the android ? When we install any apk file in real phone, where does application installed (in SD-card or other memory) ?? I have referred this link: http://groups.google.com/group/android-developers/browse_thread/thread/7965885da4d1a03a and also searched lot.

osx truncate sd card img [closed]

匆匆过客 提交于 2019-12-25 19:52:43
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I have created an image of my sd card containing raspbian using the dd tool. This gave me a 16,09 GB big image file. The actual data on there is about 5gb, and I want to truncate it so I can store/clone it onto a 8gb sd card. All help results I found required Linux to do this (tools like resize2fs doesn't appear

osx truncate sd card img [closed]

两盒软妹~` 提交于 2019-12-25 19:52:10
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I have created an image of my sd card containing raspbian using the dd tool. This gave me a 16,09 GB big image file. The actual data on there is about 5gb, and I want to truncate it so I can store/clone it onto a 8gb sd card. All help results I found required Linux to do this (tools like resize2fs doesn't appear

get images from memory card and store in drawable folder

你离开我真会死。 提交于 2019-12-25 08:39:10
问题 I made a application in which many images are shown, all images are pre-stored in drawable folder of resources, but if i want to add new picture then how can i do this, it should read from memory card but only once, after that it automatically load. 回答1: If I understand correctly, you want to upload images yourself to the app instead of letting user use images or..? If it's you, who should upload new images, you can download them to the app with a check if there are new ones. If it's the user

HTC wildfire, application crashes if phone is connected to logcat and app tries to access the sd card

我怕爱的太早我们不能终老 提交于 2019-12-25 08:36:02
问题 I have an HTC Wildfire and I'm using it for testing my applications. I want to have to phone always connected with the usb to the pc so I can see the logs in LogCat or use a debugger. The problem starts when i try to access the SD card from the app. Although the phone is in "HTC Sync" mode and I can see the logs... when the app tries to access the SD card then the app crashes. So I have to remove the usb every time I want to test and replug it (and waiiiiiit ) to redeploy the app. Any

Android pause and resume downloading file to sdcard

ⅰ亾dé卋堺 提交于 2019-12-25 03:56:52
问题 I am making an application in which I need to download a file from server and save it to sd card of android device. Apart of this there is a feature for the user to pause and resume the file. The problem I am facing is that I am able to download file to sdcard but when try to pause and resume it, it gets starts from the beginning....... Here is the source ...... public class DownloadWithProgressActivity extends Activity { public static final int DIALOG_DOWNLOAD_PROGRESS = 0; private Button

Android KitKat sdcard write permission

社会主义新天地 提交于 2019-12-25 02:55:17
问题 In android KitKat there are some limitations for writing to SDcard. So my question: Is it always permitted to write to Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) even in KitKat? 回答1: Is it always permitted to write to Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) even in KitKat? If your app has requested the WRITE_EXTERNAL_STORAGE permission, then yes, as getExternalStoragePublicDirectory() points to external storage, which is