Phone Storage Tutorial

A phone can have storage for different types of item, for example, SMS messages, and phone book entries.

This storage can be in different locations. It can be in the phoneitself, or in the SIM card for GSM networks .

Use RMobilePhone::GetPhoneStoreInfo()

Queries the storage is available and its status information like the number of slots in use.

Storage information is returned in a packaged RMobilePhoneStore::TMobilePhoneStoreInfoV1 object.

Phone storage example

The following code stores the number of free slots for the SMS messages in the variable free. The combination of the type of storage and location to query is indicated by KETelMeSmsStore flag .

The code assumes iMobilePhone is an RMobilePhone object.

TRequestStatus status;

RMobilePhoneStore::TMobilePhoneStoreInfoV1 mobilePhoneStoreInfo;
RMobilePhoneStore::TMobilePhoneStoreInfoV1Pckg mobilePhoneStoreInfoPckg(mobilePhoneStoreInfo);
iMobilePhone.GetPhoneStoreInfo(status, mobilePhoneStoreInfoPckg, KETelMeSmsStore);
User::WaitForRequest(status);
User::LeaveIfError(status.Int());

TInt free = mobilePhoneStoreInfo.iTotalEntries - mobilePhoneStoreInfo.iUsedEntries;