Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Revision as of 04:11, 3 February 2012 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

How to check if device has memory card or not

From Wiki
Jump to: navigation, search
Article Metadata
Created: rathodavinash (28 Jun 2007)
Last edited: hamishwillee (03 Feb 2012)
The following simple code tells if a device has a memory card or not.
TBool CMyContainer::HasMMC()
TBool iHasMMC;
RFs fileSession;
TDriveInfo i;
if (fileSession.Drive(i, EDriveE)==KErrNone) {
if (i.iType!=EMediaNotPresent &&
i.iType!=EMediaUnknown &&
i.iType!=EMediaCdRom &&
i.iType!=EMediaRom) {
// memory card
return iHasMMC;

Thanks to Mika Raento for this code.

Internal Links:

This page was last modified on 3 February 2012, at 04:11.
27 page views in the last 30 days.