sd-card

Accessing Storage on the Nook

谁都会走 提交于 2019-12-03 16:47:08
The closest thing to documentation I can find having to do with file storage is this post (see below if you can't access it), but it leaves me with several questions. I would really, really, really like a knowledgeable explanation of what paths map to what storage here, seeing as how we're supposed to hard-code them, and how precisely we're expected to access them. An actual code sample would be superlative. My best guess from messing around with this is that: /sdcard-> maps to the internal eMMC slot, and access is restricted. Environment.getExternalStorageDirectory(); ... still returns this.

Initialization of a microSD card using an SPI interface

眉间皱痕 提交于 2019-12-03 16:46:19
问题 I'm using a microSD card in an embedded design. The card is connected to a microcontroller using the SPI interface. It worked fine for all cards I've used before, but now my new card will not initialize. The card is a Transcend 2 GB microSD card (TS2GUSD). After sending the initial clock train to switch to SPI mode, I do the following: CMD0 (Argument 0, CRC 0x95) -> Response 0x01 -> OK CMD8 (Argument 0x000001AA, CRC 0x87) -> Response 0x01 0x000001AA -> Means it's SDC V2+ card, the voltage

How using SQLiteOpenHelper with database on sd-card?

元气小坏坏 提交于 2019-12-03 16:36:47
问题 According to various answers here and in the web extending Application and it's inherited method getDatabasePath() would allow to set the database storage path from the standard internal memory location to an inserted SD-card of bigger size. This is not working for me. The suggested construct is still using the database on internal memory. In fact the method getDatabasePath() is never called by SQLiteOpenHelper. I would like to get this up and running. Here's what I did so far: 1.) Extending

Android open or create database

故事扮演 提交于 2019-12-03 15:48:35
I am trying to create a database on my sd card. Whenever I call SQLiteDatabase.openOrCreateDatabase I get the error: 07-21 13:33:17.587: ERROR/AndroidRuntime(5541): Caused by: android.database.sqlite.SQLiteException: unable to open database file Does anyone know what may be causing this? Here is the code I have in the open() method of my database class: File sdcard = Environment.getExternalStorageDirectory(); String dbfile = sdcard.getAbsolutePath() + File.separator+ "external_sd" + File.separator + Schema.DATABASE_NAME ; db = SQLiteDatabase.openOrCreateDatabase(dbfile, null); fyr One possible

Is there a way to get SD Card size in Android?

和自甴很熟 提交于 2019-12-03 14:33:28
问题 Welcome all I have tried every question related to this in Stackoverflow and google and none of them works. I have tried something like this next link, but it returns the same as internal storage: How to get an External storage sd card size (With Mounted SD card)? For example, if I have about 12GB internal storage and 4GB SD card storage, no matter what method I use, I always get the exact same number for the SD space as I do for internal space. It seems that the old methods posted here in

Some Android devices treat Internal Storage as SD Cards and External Storage as EXTSD

社会主义新天地 提交于 2019-12-03 11:50:27
I have a bunch of Android devices from different vendors. Some of them attach /mnt/sdcard to internal storage and /mnt/extsd to external storage(Scenario 1) and others attach /mnt/sdcard to external storage(Scenario 2) I think the second scenario is standard since the Android API provides a handle to this path. Now the problem is that in scenario 1, /mnt/extsd becomes readonly even with WRITE_EXTERNAL_STORAGE permission! This means I can only read data from the actual external sd card and not be able to write to it. Is there a workaround for this so I can write to the extsd folder ?

Android FTP Server

不打扰是莪最后的温柔 提交于 2019-12-03 07:52:36
问题 I am using the following code to make the android device a ftp server (Android Internal storage). I am getting the exception of os.android.NetworkOnMainThread . I have tried to put the onStart code in the AsyncTask but app never executes and crashes on launch. Any help regarding the ftp server on Android will be great as i have no idea how to get it working. Here is the MainActivity Code package com.googlecode.simpleftp; import java.io.IOException; import java.net.ServerSocket; import java

how to differentiate between internal and external SD card path in android

人走茶凉 提交于 2019-12-03 07:46:06
问题 In android application I need to do: If(removable SdCard is present){ String path=get the path of removable Sdcard() ; //using this path we will create some files in sdcard } else{ //display error message } To achieve this we used the code as: If (Environment.getExternalStorageState().equalsIgnoreCase(Environment.MEDIA_MOUNTED)){ String path= Environment.getExternalStorageDirectory().getPath(); } The above code fails in some of latest android mobiles. Please help us on this. Below are the

How using SQLiteOpenHelper with database on sd-card?

落花浮王杯 提交于 2019-12-03 06:47:18
According to various answers here and in the web extending Application and it's inherited method getDatabasePath() would allow to set the database storage path from the standard internal memory location to an inserted SD-card of bigger size. This is not working for me. The suggested construct is still using the database on internal memory. In fact the method getDatabasePath() is never called by SQLiteOpenHelper. I would like to get this up and running. Here's what I did so far: 1.) Extending Application: public class MyApplication extends Application { @Override public File getDatabasePath

Downloading game assets to SD card on Android

こ雲淡風輕ζ 提交于 2019-12-03 06:06:56
问题 I'm developing an Android game that has to download some assets to the SD card to keep the size of the app as small as possible. I was thinking of using an uncompressed zip file to bundle all the assets. A requirement from the client is to protect these assets as much as possible. Being part of the apk is considered enough protection, but if I do this the apk size will be enormous. If I just put a zip bundle in the SD card, then anyone can unzip it and explore its contents. Is there a simple