Search This Blog

Tuesday, 22 May 2012

How to check if SdCard is supported and present in Blackberry

Hello friends,
                    Here is the simple one to get the info if SDCard is supported and present in the device or not , Follow below code:

boolean _sdcardStatus = false;

String _modelNum = DeviceInfo.getDeviceName();
        if((_modelNum.startsWith("8")&& !_modelNum.startsWith("87"))|| _modelNum.startsWith("9")){
            String root = null;
            Enumeration e = FileSystemRegistry.listRoots();
                root = (String)e.nextElement();
                    _sdcardStatus = true;

_sdcardStatus variable returns true in case SD Card is supported and present in device otherwise it returns false;

No comments:

Post a Comment