×
Namespaces

Variants
Actions
(Difference between revisions)

How to check if device has memory card or not

From Nokia Developer Wiki
Jump to: navigation, search
hamishwillee (Talk | contribs)
m (Hamishwillee - Adding missing translation link)
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot update - Fix reviewer approved and ArticleMetaData)
 
Line 1: Line 1:
{{ArticleMetaData
+
{{ArticleMetaData <!-- v1.1 -->
 
|sourcecode= <!-- Link to example source code e.g. [[Media:The Code Example ZIP.zip]] -->
 
|sourcecode= <!-- Link to example source code e.g. [[Media:The Code Example ZIP.zip]] -->
 
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
Line 6: Line 6:
 
|platform= <!-- Compatible platforms - e.g. Symbian^1 and later, Qt 4.6 and later -->
 
|platform= <!-- Compatible platforms - e.g. Symbian^1 and later, Qt 4.6 and later -->
 
|devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) -->
 
|devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) -->
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->  
+
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
|signing=<!-- Signing requirements - empty or one of: Self-Signed, DevCert, Manufacturer -->
+
|signing= <!-- Signing requirements - empty or one of: Self-Signed, DevCert, Manufacturer -->
|capabilities=<!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
+
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 
|keywords= <!-- APIs, classes and methods (e.g. QSystemScreenSaver, QList, CBase -->
 
|keywords= <!-- APIs, classes and methods (e.g. QSystemScreenSaver, QList, CBase -->
 
|id= <!-- Article Id (Knowledge base articles only) -->
 
|id= <!-- Article Id (Knowledge base articles only) -->
|language=<!-- Language category code for non-English topics - e.g. Lang-Chinese -->
+
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
|review-by=<!-- After re-review: [[User:username]] -->
+
|translated-by= <!-- [[User:XXXX]] -->
|review-timestamp=<!-- After re-review: YYYYMMDD -->
+
|translated-from-title= <!-- Title only -->
|update-by=<!-- After significant update: [[User:username]]-->
+
|translated-from-id= <!-- Id of translated revision -->
|update-timestamp=<!-- After significant update: YYYYMMDD -->
+
|review-by= <!-- After re-review: [[User:username]] -->
|creationdate=20070628
+
|review-timestamp= <!-- After re-review: YYYYMMDD -->
|author=[[User:Rathodavinash]]
+
|update-by= <!-- After significant update: [[User:username]]-->
 +
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 +
|creationdate= 20070628
 +
|author= [[User:Rathodavinash]]
 
}}The following simple code tells if a device has a memory card or not.
 
}}The following simple code tells if a device has a memory card or not.
{{ReviewerApproved}}
+
 
 
<code cpp>
 
<code cpp>
 
TBool CMyContainer::HasMMC()
 
TBool CMyContainer::HasMMC()
Line 52: Line 55:
 
[[Category:Symbian C++]]
 
[[Category:Symbian C++]]
 
[[Category:How To]]
 
[[Category:How To]]
[[Category:Code Examples]][[Category:Hardware]][[Category:Media]][[Category:Porting]]
+
[[Category:Code Snippet]][[Category:Hardware]][[Category:Media]][[Category:Porting]]
 
<!-- Translation --> [[pt:Como verificar se o dispositivo tem ou não cartão de memória]]
 
<!-- Translation --> [[pt:Como verificar se o dispositivo tem ou não cartão de memória]]

Latest revision as of 07:11, 3 February 2012

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:

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

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×