sd-card

Initialization of a microSD card using an SPI interface

二次信任 提交于 2019-12-03 05:04:54
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 range 2.7 V - 3.6 V is supported -> OK Then I should send the ACMD41 command, but when sending the CMD55

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

假如想象 提交于 2019-12-03 03:33:27
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 Stackoverflow only works until Android KitKat but do not work in next android versions. Is possible to

Creating a zip file with some files on SDCard

我是研究僧i 提交于 2019-12-03 03:02:31
As I posted a question a few days ago, I realized thet the stock eMail app couldn't send multiple files in attachment: https://stackoverflow.com/questions/5773006/sending-email-with-multiple-attachement-fail-with-default-email-android-app-but Unfortunately, I got no answer on it, so need to find a workaround. The user has to select in a list some pdf and send them by email with stock app. As the multiple attachment fail, I will create a zip file with all the requested files and sent this unique file. So, hoz can I make an archive with some files on SDCard? What I currently found is this: http:

Get sdcard directory by adb

左心房为你撑大大i 提交于 2019-12-03 01:16:25
I am making an application, which pulls files(Saved by android app) from the device sdcard by adb. The problem is that different devices, have various sdcard directories i.e: sdcard sdcard/external_sd Firstly I invented following solution: run adb shell ls Check if dir "sdcard" exists If yes run sdcard/ ls and check if external_sd exists return value. But the problem is that I have two samsung devices GT-I9100 and GT-I9000 and both have a directory sdcard/external_sd . When I am checking System.getenv("EXTERNAL_STORAGE") one returns sdcard and another sdcard/external_sd . I need to pull file

BroadcastReceiver not working when app is installed on sd card

自古美人都是妖i 提交于 2019-12-02 21:53:30
问题 I am creating a EventsManager app in which i have a BroadcastReciver which executes for BOOT_COMPLETED broadcast.this receiver has been used to re-register all the events with AlarmManager.If the app is installed on phone's memory the it works fine but in the case of sd card BOOT_COMPLETED broadcast is not being delivered to broadcast receiver. pls help.. 回答1: Quoting the documentation: In order for your application to consistently behave as expected, you should not allow your application to

Android FTP Server

孤街醉人 提交于 2019-12-02 21:21:34
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.net.Socket; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import

How to list my app downloads

风格不统一 提交于 2019-12-02 18:08:14
问题 I'm working on books library in my android app... so I want to add a functionality that allows the user to view the books that he/she has downloaded by my app.. any idea or hint to work this out? 回答1: The final solution depends a bit on the details you want to store for the books. If you only want to store the book title and author and you don't want to deal with a database yet then SharedPreferences might be an option. But they are more like Java Properties files and with this said not a

How to list my app downloads

谁说我不能喝 提交于 2019-12-02 10:55:38
I'm working on books library in my android app... so I want to add a functionality that allows the user to view the books that he/she has downloaded by my app.. any idea or hint to work this out? The final solution depends a bit on the details you want to store for the books. If you only want to store the book title and author and you don't want to deal with a database yet then SharedPreferences might be an option. But they are more like Java Properties files and with this said not a good solution for persisting more complex data structures. If you want to store more metadata of the books (e.g

Clear out android Downloads list

∥☆過路亽.° 提交于 2019-12-02 06:50:10
问题 I am trying to make an application that will do some cleanup on my device among other things I would like it to delete all of the files residing in my Download dir. I use a method like this to delete the files: private static void deleteFiles(File path) { Util.Log("deleting all files underneath " + path.getName()); if( path.exists() && path.isDirectory() ) { File[] files = path.listFiles(); for(int i=0; i<files.length; i++) { if(files[i].isDirectory()) { Util.Log(files[i].getName() + " is a

Android: How to search files on sd card?

放肆的年华 提交于 2019-12-02 06:06:47
How can I search files on my sd-card given an entered string? I'd like to search for "test" and want to get a list with all files that contain in the name the string "test": testfile.txt filetest.jpg thisisatestfile.xml etc. You can use ListFiles() of Apache Commons IO , passing a RegexFileFilter FileFilter. Example using Commons IO jar library in your Android project : Collection<File> files = FileUtils.listFiles( Environment.getExternalStorageDirectory(), new RegexFileFilter(".*test.*"), TrueFileFilter.TRUE); for(File f : files){ //---do something--- } Also, run this code in a separate