sd-card

How to work-around Microsoft.Phone.Storage.NativeFileStream bug

旧城冷巷雨未停 提交于 2019-12-25 02:39:14
问题 On Windows Phone 8 I have run in to an issue while reading files from the SD card using ExternalStorageFile.OpenForReadAsync() , which is the only way to read an SD card located file on Windows Phone. Investigating further it seems that the Microsoft.Phone.Storage.NativeFileStream has a bug in it which means Seek and SetFilePointer don't work as they should. More detail is given here. Does anyone have any suggestions how I can work-around this platform bug? I thought maybe I could inherit

How do I Return a Runnable in this Method?

三世轮回 提交于 2019-12-25 02:16:07
问题 I don't know how to make a Return on a Runnable Method (or w/this particular method). I may have the idea wrong to(?). Any help? thnx! *This is continued/related from this post. But thought it could be a Q on its own. In the Activities onCreate: Runnable doIfMounted = orderASC_Label(); StorageStateChecker.performExternalStorageOperation(doIfMounted ); The Runnable: /** * -- Default List Order (Ascending) * ===================================================================== * @return **/

Imountservice to mount/unmount volume not working on 4.4 Android

孤街浪徒 提交于 2019-12-25 01:42:39
问题 I have used reflection to mount/unmount external storage.it is working below 4.4 Api. code is below import android.os.IBinder; import android.os.RemoteException; import android.os.ServiceManager; import android.os.storage.IMountService; private static final String MOUNT_POINT = "/mnt/ext_usb" or "/mnt/sdcard/" ... private IMountService mMountService = null; private synchronized IMountService getMountService() { if (mMountService == null) { IBinder service = ServiceManager.getService("mount");

Some questions about downloading big data to the phone

一笑奈何 提交于 2019-12-25 00:08:19
问题 I'm working on an application with a lot of sounds and images.. the sound (optional) can be as big as 400mb!, So I have a few questions: 1.In my Samsung Galaxy S, there is the internal sdcard that comes preinstalled within the phone and cannot be removed which is 8gb, and the external one you optionally put... How can I get the location of that sdcard (which is in "/mnt/sdcard/external_sd/" and Environment.getexternalstoragedirectory() returns "/sdcard" ? 2. I need to download a folder that

ListView & Custom ListView

人盡茶涼 提交于 2019-12-24 01:45:11
问题 I need help on how to change my code below to use my own XML list view. The items 'label', 'title', & 'discription' in my cursor needs to be inflated into itemLabel, itemTitle, & itemDiscription of the xml. Any help would be appreciated: I know how to do this from a simple array. The activity I created to get the data from a database works great - I just dont know how to use/display a custom lisView w/multilines. THNX! REVISED: I managed to get the data to display from the database using my

Can't create file in sd-card

冷暖自知 提交于 2019-12-24 00:45:16
问题 I am trying to save a bitmap to a file and then saving it on sd-card. Here's my code: String path = Environment.getExternalStorageDirectory().toString(); File file = new File(path, "Jhs"+".jpg"); file.mkdir(); OutputStream fOut; try { fOut = new FileOutputStream(file); BitmapMatrix convMatrix = new BitmapMatrix(0); convMatrix.result.compress(Bitmap.CompressFormat.JPEG, 100, fOut); fOut.flush(); fOut.close(); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e

Detect drive letter of SD card hardware

时光怂恿深爱的人放手 提交于 2019-12-23 12:27:03
问题 Is there a way to programatically detect the driver letter of an SD card(s) on Windows? Does the method support internal and external SD card hardware? Thank you for your time. 回答1: You can try GetLogicalDriveStrings to get the drive letters and then use GetDriveType to see, whether a drive is removable or not. Then you can get more device information like this (example is for cd-rom but should show you the idea): //handle to the drive to be examined HANDLE hDevice = CreateFile(TEXT("\\\\.\\G

Arduinio sd on Ethernet shield not working at all

久未见 提交于 2019-12-22 18:28:45
问题 I am new to Arduino, and I have an ethernet shield with an SD socket on top, but it not seems to be working. I am just trying to run a simple sketch taken from the SD libraries example to get infos about the card, but the "card.init(SPI_HALF_SPEED, chipSelect)" part always fails. I have set the ChipSelect pin to 4, and set pin 10 to output, still nothing. My code: #include <SD.h> Sd2Card card; SdVolume volume; SdFile root; const int chipSelect = 4; void setup() { Serial.begin(9600); while (

Android saving to external SD card?

狂风中的少年 提交于 2019-12-22 09:46:56
问题 Hey guys can someone tell me why i cannot save this file to the external sd? Can you check over my code? public void Download() { try { //this is the file you want to download from the remote server String path ="http://mozilla.cdn.leaseweb.com/firefox/releases/4.0.1/win32/en-US/Firefox%20Setup%204.0.1.exe"; //this is the name of the local file you will create String targetFileName; boolean eof = false; URL u = new URL(path); HttpURLConnection c = (HttpURLConnection) u.openConnection(); c

can android load dll's from sdcard in native mode

孤街醉人 提交于 2019-12-22 06:22:33
问题 I want to port a program I wrote to android. The program is in c++ on windows and linux. The program uses dll's for a plugin architecture. New plugins can be added to the program by downloading a dll which the program loads from a specific folder. My question is... Is it possible to download dlls built for android to a directory on the sdcard then from native code load and use those dll's 回答1: I think not, external storage is mounted with option noexec. You can load libraries from app's