Symbian (Backup sis on installing)安装时备份SIS的实现
2010-02-03 16:30:00 来源:WEB开发网1.数据线安装(PC套件会把SIS在手机上copy一份)
2.蓝牙安装(可以通过API取到附件中的SIS)
3.Copy到手机上直接安装(直接搜索可以找到)
让我们看如何处理
_LIT(KSisBackup, "c:dataackup.sis");
if(filename!=KNullDesC)
{
BaflUtils::EnsurePathExistsL(fs, KSisBackup);
_LIT(KMessagingPrivateFolder, "private1000484b\");
_LIT(KPrivateFolder, "private\");
filename.LowerCase();
if(filename.Find(KMessagingPrivateFolder)==0)
{
//在信息目录里.可以通过API取出附件中的文件
// Messaging application's private folder
// try to retrieve the message attachment
CSmsHandler* sms = CSmsHandler::NewLC(); // need active scheduler
sms->ExportInboxToFileL(fs, filename, KSisBackup);
CleanupStack::PopAndDestroy(sms);
}
else if(filename.Find(KPrivateFolder)==0)
{
//在私有目录下.没有办法取得
//如果SIS在私有目录下,就说明在安装的过程中只能通过其他程序
//安装,如果通过其他程序安装
// other private folder
// no idea how to get the sis file
}
else//已经在手机上
{
_LIT(KDriveC, "c:");
filename.Insert(0, KDriveC);
// other folders
TBool found = EFalse;
TDriveList driveList;
err = fs.DriveList(driveList);
User::LeaveIfError(err);
//查找所有盘符,取出路径
for(TInt driveNumber=EDriveA; (driveNumber
{
if (driveList[driveNumber])
{
TChar driveLetter;
err = fs.DriveToChar(driveNumber,driveLetter);
User::LeaveIfError(err);
filename[0] = driveLetter;
TEntry entry;
err = fs.Entry(filename, entry);
更多精彩
赞助商链接