Re: SD CARD AVAILABILITY PROBLEM

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

Re: SD CARD AVAILABILITY PROBLEM

Postby krishjlk » Fri May 20, 2011 1:19 pm

hELLO I WANT TO KNOW WHETHER SD CARD IS AVAILABLE IN MY DEVICE OR NOT

HOW TO CHECK IT PROGRAMATICALLY ???


PLZ POST .... SOME REPLY

I HAVE ALREADY TRIED Environment.getExternalStorageDirectory();
but it is not working .................
/*
A good programmer is the one who always looks both ways b4 crossing a one-way street
*/
User avatar
krishjlk
Experienced Developer
Experienced Developer
 
Posts: 52
Joined: Fri May 20, 2011 6:09 am
Location: KK , @Ahmedabad, Gujrath, India

Top

Re: SD CARD AVAILABILITY PROBLEM

Postby raj_J2ME » Mon May 23, 2011 7:14 am

krishjlk wrote:hELLO I WANT TO KNOW WHETHER SD CARD IS AVAILABLE IN MY DEVICE OR NOT

HOW TO CHECK IT PROGRAMATICALLY ???


PLZ POST .... SOME REPLY

I HAVE ALREADY TRIED Environment.getExternalStorageDirectory();
but it is not working .................

Well, that is the way for the recommended way to check for the presence of the external SD card, and whether or not you can write to it.

This example checks whether the external storage is available to read and write. The getExternalStorageState() method returns other states that you might want to check, such as whether the media is being shared (connected to a computer), is missing entirely, has been removed badly, etc. You can use these to notify the user with more information when your application needs to access the media.

Check the example http://developer.android.com/guide/topics/data/data-storage.html#filesExternal
Thanks with Regards,
Raj - The Kernel
raj_J2ME
Master Developer
Master Developer
 
Posts: 311
Joined: Tue Feb 15, 2011 7:40 am
Location: The Capital of India,

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: Google [Bot] and 16 guests