sd-card

External SDCard file path for Android

橙三吉。 提交于 2019-11-28 08:24:25
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 do this by detecting the existence of file "/storage/extSdCard" alone? Thanks. Digoun Is it true that

android: how to listen to “sd card removed unexpectedly”

自古美人都是妖i 提交于 2019-11-28 08:14:52
问题 I have a program that uses content from sd-card. I want to listen to different states like sd-card mounted or sd-card removed unexpectedly. How can I do so. An example would be of a great help. Thanks to all 回答1: You need to listen for ACTION_MEDIA_REMOVED and ACTION_MEDIA_MOUNTED. Create a receiver and listen for this action. EDIT: In your manifest file add this <receiver android:name=".MyReceiver" > <intent-filter> <action android:name="android.intent.action.MEDIA_REMOVED" /> <action

getExternalStorageDirectory not working

£可爱£侵袭症+ 提交于 2019-11-28 07:57:56
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? 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 the path to maintain uniqueness. The primary (default) user's ID is 0. So you get /storage/emulated/0/ as

Initializing SD card in SPI issues

守給你的承諾、 提交于 2019-11-28 07:42:55
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 I'm having problems on three other random cards from my stash of old cards that I've used on my camera

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

人走茶凉 提交于 2019-11-28 07:03:10
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 gotten one of those code samples to compile. Is it possible? And if so--HOW! Please note that Froyo's "apps

Play mp3 sounds from SD card

巧了我就是萌 提交于 2019-11-28 03:24:39
问题 I have a directory on my tablet's SD card called "/Android/data/com.example.android.app/files". I just created it manually because I don't know how else to test this aspect of my app. I have filenames stored in a sqlite database like "/folder1/audio1.mp3", "/folder2/audio1.mp3", etc... The files have the same names, but are in different folders, as they are the same thing is different languages. I have those folders (folder1 and folder2) and all of the mp3 files in the "/Android/data/com

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

爱⌒轻易说出口 提交于 2019-11-28 01:41:51
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<HashMap<String, String>>(); // Constructor public SongsManager(){ } /** * Function to read all mp3 files

How to read a selected text file from sdcard on android

好久不见. 提交于 2019-11-28 00:15:06
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.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android

EACCESS Permission denied in Android

淺唱寂寞╮ 提交于 2019-11-28 00:08:32
While writing file in External SD card I am getting an error EACCESS permission denied. I have set the permission <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> But the when I read the file I am successfully able to read it but not able to write the file. The code that I am using for writing the file in SD card is: String path="mnt/extsd/Test"; try{ File myFile = new File(path, "Hello.txt"); //device.txt myFile.createNewFile(); FileOutputStream fOut = new FileOutputStream(myFile); OutputStreamWriter myOutWriter = new OutputStreamWriter(fOut); myOutWriter.append

How to get an External storage sd card size (With Mounted SD card)?

做~自己de王妃 提交于 2019-11-27 19:53:57
Link :I worked on based on this Link I added this line to find the size (both Internal and External) size, return availableExternalMemorySize/(1024*1024); I tested in my Tablet. I am getting both Internal and External SD card size as, In Internal Storage: Total Memory --1007 Available Memory --683 In External Storage: Total Memory -- 1763 Available Memory -- 1554 But in Tablet, I saw settings. An External Storage size has 8GB. But it is showing me 1.7 GB around when I tested via programmatically. What is the procedure to find an External storage size? To get the external SD card's available