android-sdcard

Android 2.1 programmatically unmount SDCard

北城以北 提交于 2019-12-02 17:25:00
问题 I have an application that writes important data to the SDCard and encrypts it using AES, which later will be used by a desktop application. I have noticed that if I do not unmount the SDCard from the Settings menu sometimes the files don't get written at all, or are corrupted. Is there anyway in Android 2.1 that I can unmount the SDCard programmatically? Because I'm pretty sure that from time to time the users will forget to do this, and I'll be the one fixing the problems and I really don't

Permission of app specific folder on external storage

∥☆過路亽.° 提交于 2019-12-02 12:19:44
问题 Can someone explain the permission of the app specific folder /Android/data/< package_name>/files/ as described here http://developer.android.com/guide/topics/data/data-storage.html#filesExternal It is not clear when it is truly private to the app and when it is world-readable. Is it the case that when the USB mass storage is enabled the files in the external storage, including the app specific folder, are world readable? I tried using a file manager app (ASTRO file manager) and I am able to

How can i add sdcard images to coverflow?

允我心安 提交于 2019-12-02 12:13:02
Here is my coverflow with drawables :( This is my Image Adapter Code /** The Constant IMAGE_RESOURCE_IDS. */ private static final List<Integer> IMAGE_RESOURCE_IDS = new ArrayList<Integer>(DEFAULT_LIST_SIZE); /** The Constant DEFAULT_RESOURCE_LIST. */ private static final int[] DEFAULT_RESOURCE_LIST = { R.drawable.promo_blue_bg_medium, R.drawable.promo_green_bg_medium, R.drawable.flow, R.drawable.promo_yellow_bg_medium, R.drawable.promo_black_bg_medium , }; /** The bitmap map. */ private final Map<Integer, WeakReference<Bitmap>> bitmapMap = new HashMap<Integer, WeakReference<Bitmap>>(); private

Android: How to save/restore data

↘锁芯ラ 提交于 2019-12-02 11:02:42
问题 In my app I have a Linked List (I use the standard List()). I want this list to be saved to the sd card (or the phone memory) every time the user exits the app and restore it every time the user starts the app. How can I do it ? 回答1: you can use SharedPreferences , refer the doc , and this tutorial to understand how to do it :) 回答2: The Android Developer site has an excellent guide how you can store your data on the phone. 来源: https://stackoverflow.com/questions/7665339/android-how-to-save

Access sd card in android for uploading a file to my php server using phonegap

那年仲夏 提交于 2019-12-02 09:09:53
I want to go to select a file from sdcard and upload it to server. is it possible to access the sdcard in android via phonegap as how we are picking a image from gallery and uploading. I went through samples but all are specifying the file name also like eg: mnt/sdcard/read.txt. But i want to goto only sdcard so that user can select his own file is it possible to do. U can easily do that its very easy window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onFileSystemSuccessUpload, fail); function onFileSystemSuccessUpload(fileSystem) { // get directory entry through root and access all the

How to store a file on an SD card (external)

早过忘川 提交于 2019-12-02 08:57:53
问题 I want to store a file on the SD card using File . I already achieved to store a file in external storage (named internal storage in my file explorer app. This is NOT the SD card). I read much about storing data on SD cards and often saw: new File(Environment.getExternalStorageDirectory() + "/MyFile") But this will store the file on external storage and not on the SD card. So how can I store a file on the SD card and not on external storage? 回答1: Ideally, you use the Storage Access Framework

Android: How to save/restore data

无人久伴 提交于 2019-12-02 06:46:19
In my app I have a Linked List (I use the standard List()). I want this list to be saved to the sd card (or the phone memory) every time the user exits the app and restore it every time the user starts the app. How can I do it ? you can use SharedPreferences , refer the doc , and this tutorial to understand how to do it :) The Android Developer site has an excellent guide how you can store your data on the phone. 来源: https://stackoverflow.com/questions/7665339/android-how-to-save-restore-data

Permission of app specific folder on external storage

南楼画角 提交于 2019-12-02 04:52:46
Can someone explain the permission of the app specific folder /Android/data/< package_name>/files/ as described here http://developer.android.com/guide/topics/data/data-storage.html#filesExternal It is not clear when it is truly private to the app and when it is world-readable. Is it the case that when the USB mass storage is enabled the files in the external storage, including the app specific folder, are world readable? I tried using a file manager app (ASTRO file manager) and I am able to see/open files in the app specific folders on the sdcard and this is irrespective of the setting

app-inventor: install apps onto SD card

本小妞迷上赌 提交于 2019-12-02 02:34:15
问题 [edited to show current state of play a week after asking the question] I delved into app inventor because my kids (age 10 and 12) are about to get their first android phones, and have done some drag and drop programming (game maker) so I thought it might be a good entry point for them. I have now written 5 apps myself with app inventor, and installed 4 onto my phone, and I can't install the 5th one because I am "out of memory" apparently, despite having 3 gigs free on the SD card on the

Device claims external storage, yet I have no SD card

点点圈 提交于 2019-12-02 00:31:18
问题 Samsung galaxy S3 with no SD card, I'm using this code to check storage states. Using this code: boolean mExternalStorageAvailable = false; boolean mExternalStorageWriteable = false; String state = Environment.getExternalStorageState(); if (Environment.MEDIA_MOUNTED.equals(state)) { // We can read and write the media mExternalStorageAvailable = mExternalStorageWriteable = true; } else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) { // We can only read the media