Where should the file be stored in the mobile phone?
I need to put a file in the mobile phone, the PKG file written this: "/ Symbian / 6.1 / series60 / ePoc32 / release / wins / udeb / z / system / data / data.dat" - "!: / System / apps / Test / data.dat "When running in the simulator, read the absolute path in the program: z: //system//Data/Data.dat runs in the phone, the program read path is: E: // system //apps/test//data.dat runs properly on the simulator, installed on the phone, can't run, don't know why
This path can be written and can be ruled: Method 1:
CODE:
_LIT (KbitmapFileName, "C: //system//apps/test//xxx.mbm");
Const tuint16 kmmcdriveletter = 'e';
Const tuint16 kromdriveletter = 'z';
// Try 3 Locations - Application Directory IN C, E (Memory Card), And Z Drive
TFileName Imagelocation (KbitmapFileName);
Tint loaderr = iimageflag-> load (imagelocation, usefullscreen);
// Not Found on C, Try E & Z
IF (Loaderr! = Kerrnone)
{
ImageLocation [0] = kmmcdriveletter;
Loaderr = iimageflag-> loading (imagelocation, usefullscreen);
IF (Loaderr! = Kerrnone)
{
ImageLocation [0] = KromDriveletter; // in emulator, apps usually reside on z
Loaderr = iimageflag-> loading (imagelocation, usefullscreen);
}
}
Method Two:
CODE:
Void getFullPathname (TDES & AFILENAME)
{
// Get Default Drive and Path
TPARSE PARSE;
TFileName AppPath;
TBUF <5> AppDrive;
PARSE.SET (CEIKONENV :: Static () -> Eikappui () -> Application () -> appfullname (), null, null;
Apppath.copy (Parse.DriveandPath ());
Appdrive.copy; Parse.Drive ());
// Parse the file name
Parse.set (AfileName, NULL, NULL);
IF (Parse.Drive (). Length () == 0)
{
IF (parse.path (). Length () == 0)
{// use default path and driving
AfileName.Insert (0, AppPath);
}
Else
{// use default drive
AfileName.Insert (0, AppDrive);
}
}
}
Regardsmaxying