sd-card

Is there a way to tell if the sdcard is mounted vs not installed at all?

萝らか妹 提交于 2019-12-17 20:27:03
问题 Using the api logic you can detect if the sd card is available for read or write, but it doesn't tell you why it is not writable. I want to know if the user even has a sd card vs if it just mounted. Is this possible? 回答1: for example: String state = Environment.getExternalStorageState(); if (state.equals(Environment.MEDIA_MOUNTED_READ_ONLY)) { } Check out the possible constants at : http://developer.android.com/reference/android/os/Environment.html#getExternalStorageState%28%29 回答2: public

Android copy image from gallery folder onto SD Card alternative folder

老子叫甜甜 提交于 2019-12-17 19:32:51
问题 I am looking for someone to assist in the code i require in my application to copya image from where they get stored on the HTC desire as standard(the gallery) to a another folder on the SD card. I want the user to be able to click on a button and a certain file is copied from the SD card gallery folder to the another folder on the SD card? Thanks 回答1: Usmaan, You can launch the gallery picker intent with the following: public void imageFromGallery() { Intent getImageFromGalleryIntent = new

Initializing SD card in SPI issues

*爱你&永不变心* 提交于 2019-12-17 18:29:09
问题 I've had a look at Stack Overflow question Initialization of a microSD card using an SPI interface and didn't see any answers that matched my issue (that is, things I haven't already tried). I have a similar issue where I'm trying to access a SD card through a microcontroller's SPI interface (specifically an HC908). I've tried following the flow charts in the Physical Layer Simplified Specification v2.00 and it seems to initialize correctly on Transcend 1 GB & 2 GB and an AE&C 1 GB card. But

How to access all mp3 files from all the subfolders in the sdcard?

こ雲淡風輕ζ 提交于 2019-12-17 16:53:27
问题 I'm trying to make an mp3 player app, and when I run it from my phone it only reads MP3's that are present on the SD card itself. It does not read any MP3's from the subfolders that are present in the card. I want it to display all the MP3's present in the SD card(including the subfolders). public class SongsManager { // SDCard Path final String MEDIA_PATH = new String(Environment.getExternalStorageDirectory().getPath()); private ArrayList<HashMap<String, String>> songsList = new ArrayList

How to read a selected text file from sdcard on android

筅森魡賤 提交于 2019-12-17 16:38:29
问题 i am new at android development and i need your help. I was locking at topics that are similar for my development but non of then help me. So far i create functions that gets me the files from my sdcard and shows me the list of then. That is working this is the code for getting the paths on sdcard: package com.seminarskirad; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.app.ListActivity; import android.content.Context; import android.content

Installing application on SD-card in Android sdk 2.2

感情迁移 提交于 2019-12-17 16:29:09
问题 I am facing this problem and finding solution for this issue since last 2 weeks. Right now i have developed an android application for the client perpose, whose size is 54 MB, from which 52 MB of only Images/Photos. [Edit: I need to keep images in "drawable" folder ] So i want to install it in sd-card on Android SDK 2.2 for that i have already set android:installLocation="preferExternal" in the AndroidManifest.xml file. I have created 256MB sd-card while creating an avd , heap size - 192 ,

Save image to sdcard from drawable resource on Android

[亡魂溺海] 提交于 2019-12-17 03:39:20
问题 I'm wondering how to save an image to user's sdcard through a button click. Could some one show me how to do it. The Image is in .png format and it is stored in the drawable directory. I want to program a button to save that image to the user's sdcard. 回答1: The process of saving a file (which is image in your case) is described here: save-file-to-sd-card Saving image to sdcard from drawble resource: Say you have an image namely ic_launcher in your drawable. Then get a bitmap object from this

Manually put files to Android emulator SD card

只谈情不闲聊 提交于 2019-12-17 02:58:11
问题 I'm just having trouble with getting my emulator SD card work... I created a new AVD device with a new SD card. So how to put data onto it? I found the "correct" file to be mounted on Daemon tools, but is corrupt or simply not readable... It would be great if you have any idea :) 回答1: If you are using Eclipse you can move files to and from the SD Card through the Android Perspective (it is called DDMS in Eclipse). Just select the Emulator in the left part of the screen and then choose the

App can´t play a video from the SD-Card despite the fact that the code looks fine

╄→尐↘猪︶ㄣ 提交于 2019-12-13 21:26:38
问题 I use the code below to play a video from my SD-Card using Video View of Android. I placed a video file named Video.mp4 in the external storage root directory. But when starting my App on my Smartphone and switching to my video activity with the code below for Video.java I see a notification with an OK button saying that the video can not be played. (German: "Video kann nicht wiedergegeben werden.") Is it a missing permission in my AndroidManifest.xml? Thanks in advance for any hints and help

Save pictures to custom folder in media library

ⅰ亾dé卋堺 提交于 2019-12-13 14:11:34
问题 WhatsApp now saves pictures to a custom folder named "WhatsApp" in the media library. Is WhatsApp using a undocumented API or is this possible for every developer? Right now I am only aware of the possibility to save pictures to the "Camera Roll" or to the "Saved Pictures". 回答1: It appears WhatsApp has special permission to do that as no current APIs for Windows Phone 8 (with GDR3) allow you to specify a folder name. The hope is that Windows Phone 8.1 will introduce new APIs for both saving