On Dec 19, 7:46 am, savanevery <[email protected]> wrote: > I believe Mark is right, you need to unmount the SD card from your > computer. You should still be able to debug and deploy applications > on the device, you just can't have it in the mode where it looks like > a drive on your machine for file browsing. > > The example you are using leverages the built-in camera application > which requires the SD card for saving the image. You can get around > that issue by building a custom camera application.
After finally figuring out how to do this (Windows doesn't make it easy), I found it didn't make any difference. I went through the "Safely remove hardware" steps, and that removed the drive from File Explorer. Then, I reran the app, and it still complained about the SD card when I pressed the camera button. At that point I disconnected the USB cable and pressed the camera button again, and this time it worked. > On Dec 19, 5:24 am, Mark Murphy <[email protected]> wrote: > > > On Sun, Dec 19, 2010 at 1:29 AM, David Karr <[email protected]> > > wrote: > > > Sorry, I need more information. > > > ? > > > > You're saying that because I had the phone connected to my computer > > > with the USB cable (so I could deploy the application to the device), > > > that means that the SD card in the phone is mounted on the WinXP box, > > > and so can't be used from the phone? > > > No, I mean that if you mounted the SD card as a drive while connected > > to USB, the SD card is unavailable to Android. > > > > Is there something that should > > > be done in the setup of the test on the phone so that I would unmount > > > the SD card from the WinXP box, but still let me step through the code > > > while it's running on the phone? > > > Don't mount the drive in the first place. Or, unmount it the way you > > would any other USB drive (e.g., icon in the task tray). > > > > Calling Environment.getExternalStorageState() will tell me the > > > "current state" of the SD card. How does that help me? > > > App users sometimes mount their external storage (e.g., SD cards). > > Apps, therefore, should not blindly write to external storage, but > > should check the storage state first. > > > Again, this is all based on an educated guess that your problem > > stemmed from your having mounted your phone's external storage as a > > drive in Windows. > > > -- > > Mark Murphy (a Commons > > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > > _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9 > > Available! > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

