Symbian手机平台开发经验总结
2010-09-06 08:10:00 来源:WEB开发网15、获取手机剩余内存字节数
TMemoryInfoV1Buf info;
UserHal::MemoryInfo(info);
TInt freeMemory = info().iFreeRamInBytes;
16、控制用户输入长数字串
void CTestDlgDialog::PrepareLC(TInt aResourceId)
{
CEikDialog::PrepareLC( aResourceId );
// Pick up the Editor control from the dialog
CEikEdwin* control = static_cast
// Set the input mode
control->SetAknEditorInputMode(EAknEditorNumericInputMode);
// Restrict the other input modes
control->SetAknEditorAllowedInputModes(EAknEditorNumericInputMode);
}
17、播放wav声音文件
const TInt KSnapSoundId = 2;
CAknKeySoundSystem* iCameraSound;
iCameraSound =
static_cast
if (iCameraSound)
{
TRAPD(error, iCameraSound->AddAppSoundInfoListL(R_CAMERA_SNAP_SOUND));
if ((error != KErrAlreadyExists) && (error != KErrNone))
{
User::LeaveIfError(error);
}
}
iCameraSound->PlaySound(KSnapSoundId);
//以下在rss文件中定义
#define KcameraSoundFile "Z:\system\sounds\digital\Camera1a_2_8kHz.wav"
#define KSnapSoundId 2
RESOURCE AVKON_SOUND_INFO_LIST r_camera_snap_sound
{
list =
{
AVKON_SOUND_INFO
{
sid = KSnapSoundId;
priority = 45;
preference = EAknAudioPrefCamera; // defined in avkon.hrh
file = KCameraSoundFile;
}
};
}
18、搜索可用的WLAN网络
#include
void CWlanTest:: ListNetworksAndSignalL(CDesCArraySeg& aNetworks)
更多精彩
赞助商链接