Namespaces
Variants
Actions
Revision as of 07: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

Jump to: navigation, search
Article Metadata

Article
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;
iHasMMC=EFalse;
 
RFs fileSession;
fileSession.Connect();
 
TDriveInfo i;
if (fileSession.Drive(i, EDriveE)==KErrNone) {
if (i.iType!=EMediaNotPresent &&
i.iType!=EMediaUnknown &&
i.iType!=EMediaCdRom &&
i.iType!=EMediaRom) {
// memory card
iHasMMC=ETrue;
}
}
fileSession.Close();
return iHasMMC;
}

Thanks to Mika Raento for this code.

Internal Links:

140 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved