Namespaces

Variants
Actions

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 over the next few weeks. Thanks for all your past and future contributions.

Talk:How to check if device has memory card or not

From Wiki
Jump to: navigation, search

Under drive lette E may be internal non removable card. Like - mass media internal storage. Your code is not correct.

Contents

Jp4symbian - Memory card or mass memory?

Has anyone figured out how to differentiate memory card from mass memory. Both have similar TDriveInfo type of EMediaHardDisk.

Also PathInfo::MemoryCardRootPath() returns the Mass memory drive rather than the Memory card drive.

jp4symbian 16:00, 13 October 2011 (EEST)

Hamishwillee - @Jp4symbian - perhaps KDriveAttRemovable

Hi @Jp4symbian

Its quite possible the author is not watching this article which they created in 2007. I suggest you raise the request on the forums - but I would appreciate it if you added the answer to the article if you find one.

I suspect the mass memory is just a MMC card soldered in, which is why it returns as a memory card for PathInfo. I'd search on KDriveAttRemovable in the library.

Regards

H

hamishwillee 03:52, 14 October 2011 (EEST)

Jp4symbian -

Hi Hamishville,

I just posted in case someone reaches this page while searching & might know the solution.

My test on Nokia C7 says that KDriveAttRemovable is set for both Mass Memory & Memory Card.

jp4symbian 09:37, 14 October 2011 (EEST)

Hamishwillee - That sux.

Hi @Jp4symbian

Thanks for letting me know. That is bad. Can we reasonably assume that the drive will be the later of any drives that report themselves as MMC? Otherwise I again suggest you try the discussion boards. If you don't get an answer in a few days send me a link (private messaging) and I'll see if I can find a file system person from my mis-spent Symbian Ltd days to give us an answer.

Regards

H

hamishwillee 08:33, 17 October 2011 (EEST)

Patrickfrei -

Hi

On S60 devices I'm using a "top-down" approach: First, I'm scanning for EDriveF, then for EDriveE. As type, I've set EMediaHardDisk for both, memory card and mass memory. If there's a mass storage available, the memory card will probably have drive letter F and subsequently the memory card will have drive letter E. If there's no mass storage, drive letter F will be not in use and therefore the memory card will have drive letter E. I can confirm that KDriveAttRemovable is set for both memories.

Regards

Patrick

patrickfrei 19:28, 3 November 2011 (EET)

Hamishwillee - @patrick - copy in your code?

Hi Patrick

Would it be possible for you to copy your code into the article in its own section? That would save other developers having to re-invent the wheel.

Regards

Hamish

hamishwillee 05:31, 4 November 2011 (EET)

Patrickfrei -

@Hamishwillee

I've done something like that...

for (TInt driveNumber=EDriveF; driveNumber>=EDriveE; driveNumber--)
{
fileSession.Drive(driveInfo,driveNumber);
if(driveInfo.iType == EMediaHardDisk)
{
// if there is a mass storage (EDriveE), the memory card (EDriveF) will be detected during the first loop
// if there is no mass storage, the memory card will be detected during the second loop as it will be on EDriveE
break;
}
}
Anyway, it's only an approximation and still not a bullet-proof solution as there are obviously some phones with Z-Drive. And in fact, the mass storage is also a memory card (MMC). I've check that by reading the CID register. That's probably why KDriveAttRemovable is also set for the mass storage.

patrickfrei 13:19, 6 November 2011 (EET)

Hamishwillee - @Patrickfrei - thanks

Thanks Patrick, its a start for people, which is a good thing. When/if a bullet proof set of code is created it should be merged into the above article. regards

H

hamishwillee 07:38, 9 November 2011 (EET)

 

Was this page helpful?

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

 

Thank you!

We appreciate your feedback.

×