×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Regular Contributor
    Join Date
    Aug 2006
    Posts
    252

    question where save file

    Hi,
    in my program for 3rd I have a file of configuration that I insert in app.pkg inside this folder:

    "C:\progetti\app\data\about.properties"-"!:\system\apps\app\about.properties"

    But when i install my application inside memory card, this file is not found.
    If I install application on phone memory is all ok.
    I try to insert this file inside folder "resource" but application give me error of portection.
    Where i insert this file for do work application olso in memory card?
    Thanks
    SIlvia

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,694

    Re: question where save file

    Binary config-files should be usually stored in your private folder.

  3. #3
    Regular Contributor
    Join Date
    Aug 2006
    Posts
    252

    Re: question where save file

    Quote Originally Posted by wizard_hu_ View Post
    Binary config-files should be usually stored in your private folder.
    Hi,
    file not is binary but text.
    This a new rules of 3rd?

  4. #4
    Regular Contributor
    Join Date
    Aug 2006
    Posts
    252

    Re: question where save file

    Maybe I give to my program particular CAPABILITY??
    I use:
    LocalServices Location NetworkServices ReadDeviceData ReadUserData WriteDeviceData WriteUserData

    I need to insert other for read from directory on memory card?

  5. #5
    Regular Contributor
    Join Date
    Aug 2006
    Posts
    252

    Re: question where save file

    Problem if maybe how I create folder for my application.
    The strange thing is that with fexplorer I cannot enter inside this folder" system\apps\myapp, fexplorer give me error "user 11", but if I open for example system\apps\navigator I see all file without problem.
    When do I wrong??

    Thanks

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,694

    Re: question where save file

    Your private folder is \private\<your UID3 or SID> on any drive. For example where you put the _reg.rsc (\private\10003a3f), that is the private folder of an other application (the menu application in particular).
    You can also use RFs::CreatePrivatePath and PrivatePath.
    However if it is a text file, and the user should be able to access/modify it on the device, both \private and \system\apps (which is not a standard location in case of 3rd edition anyway) are wrong choices.

  7. #7
    Regular Contributor
    Join Date
    Aug 2006
    Posts
    252

    Re: question where save file

    Quote Originally Posted by wizard_hu_ View Post
    Your private folder is \private\<your UID3 or SID> on any drive. For example where you put the _reg.rsc (\private\10003a3f), that is the private folder of an other application (the menu application in particular).
    You can also use RFs::CreatePrivatePath and PrivatePath.
    However if it is a text file, and the user should be able to access/modify it on the device, both \private and \system\apps (which is not a standard location in case of 3rd edition anyway) are wrong choices.
    Ok, and what is correct position??

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,694

    Re: question where save file

    Quote Originally Posted by silviuccia View Post
    Ok, and what is correct position??
    It still depends:
    - if the user should be able to access it from the built-in file manager and possibly edit the file, an accessible location could be anything under c:\Data or e:\, so !:\Data would work for example
    - if you do not want the user to edit/access your config file, \private\<your UID3/SID> is a suitable location.

  9. #9
    Regular Contributor
    Join Date
    Aug 2006
    Posts
    252

    Re: question where save file

    It is incredible but any folder I use if is inside phone memory work, otehrwise my app tell me that file not exist...maybe is a problem of my class of read??
    I use this, is correct?

    Code:
    TBool CManageFile::Open(const TDesC& afileName, TUint afileMode, 
    						const TDesC& path, TUint create) 
    {
    	RFs fsSession;
    
    	fsSession.Connect();	
    	fsSession.MkDirAll(path);		
    	fsSession.Parse(afileName,path,Fname);
    	
    	TInt err=file.Open(fsSession,Fname.FullName(),afileMode); 
    	if (err==KErrNotFound) 
    	{
    		if(create == 0)
    		{
    			User::InfoPrint(_L("file not exist"));
    			return EFalse;
    		}	
    		else
    		{
    			file.Create(fsSession,Fname.FullName(), EFileWrite);
    			Close();
    			return file.Open(fsSession,Fname.FullName(),afileMode); 
    		}
    	}
    	
    	return ETrue;
    }
    Best regards
    Silvia

  10. #10
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,694

    Re: question where save file

    It is hard to say anything without knowing the path/filename arguments.
    If you have a hardcoded c:\, you obviously will not find files installed to e:\ with !:\ target in the .mmp.
    Forget hardcoded x:-s, and use CompleteWithAppPath, if you need such flexibility.

  11. #11
    Regular Contributor
    Join Date
    Aug 2006
    Posts
    252

    Re: question where save file

    Quote Originally Posted by wizard_hu_ View Post
    It is hard to say anything without knowing the path/filename arguments.
    If you have a hardcoded c:\, you obviously will not find files installed to e:\ with !:\ target in the .mmp.
    Forget hardcoded x:-s, and use CompleteWithAppPath, if you need such flexibility.

    Sorry
    I use tis type of path:
    _LIT(KPathApp,"\\data\\app\\");
    _LIT(KFile, "configuration.dat");

    and I found driver where application is installed with

    Code:
    void CMYAPP::getDrive(TBuf<50> drive)
    	{
    	 	TFileName applicationFileName = RProcess().FileName();
    		TParse parse;
    		parse.Set(applicationFileName,NULL,NULL);
    		
    		drive.Copy(parse.Drive());
    	}
    Insede mmp I don't use path..
    this is my mmp:

    Code:
    /*
    ============================================================================
     Name        : app.mmp
     Author      : Silvia
    Description : This is the project specification file for app.
    ============================================================================
    */
    
    TARGET            app.exe
    TARGETTYPE        exe
    UID		  0x0 0xXXXX
    
    SOURCEPATH        ..\src
    
    ....
    
    SOURCEPATH        ..\data
    
    START RESOURCE    app.rss
    HEADER
    TARGETPATH resource\apps
    END //RESOURCE
    
    START RESOURCE    app_reg.rss
    TARGETPATH 	  \private\10003a3f\apps
    END //RESOURCE
    
    
    
    USERINCLUDE       ..\inc
    
    SYSTEMINCLUDE     \epoc32\include ..
    
    LIBRARY           euser.lib
    LIBRARY           apparc.lib
    LIBRARY           cone.lib
    LIBRARY           eikcore.lib
    LIBRARY           avkon.lib
    LIBRARY           commonengine.lib
    LIBRARY		  efsrv.lib 
    LIBRARY           estor.lib
    LIBRARY           lbs.lib
    
    
    LIBRARY 	  esock.lib //per i socket
    LIBRARY		  insock.lib //per i socket
    LIBRARY           commdb.lib
    LIBRARY		  apengine.lib 
    LIBRARY        	  msgs.lib        // for MMsvSessionObserver
    
    LIBRARY         smcm.lib        // for TSmsMtmCommand
    LIBRARY		apgrfx.lib      //per foreground
    LIBRARY		ws32.lib 		//per back
    LIBRARY         eikcdlg.lib      // for CEikDialog
    LIBRARY         eikdlg.lib
    LIBRARY         eikcoctl.lib    // for CEikBorderedControl
    LIBRARY		edbms.lib	//per la gestione del database per la licenza
    LIBRARY		gsmu.lib	//per prendere numero di telefono
    
    
    LIBRARY		aknskins.lib //per sfondo
    LIBRARY		aknskinsrv.lib  //per sfondo
    LIBRARY		aknswallpaperutils.lib  //per sfondo
    LIBRARY		apsettingshandlerui.lib
    
    LIBRARY		etel.lib //imei
    LIBRARY		Etel3rdParty.lib
    
    
    
    LANG SC
    
    VENDORID	  	  0
    SECUREID	      0xXXXXXX
    CAPABILITY	  	  LocalServices Location NetworkServices ReadDeviceData ReadUserData WriteDeviceData WriteUserData
    
    // End of File

    And finaly my pkg

    Code:
    
    ;Language - standard language definitions
    &EN
    
    ; standard SIS file header
    #{"app"},(0xXXXX),1,0,0
    
    ;Localised Vendor name
    %{"Vendor-EN"}
    
    ;Unique Vendor name
    :"Vendor"
    
    ;Supports Series 60 v 3.0
    [0x101F7961], 0, 0, 0, {"Series60ProductID"}
    
    ;Files to install
    "C:\Symbian\9.2\S60_3rd_FP1_2\Epoc32\release\gcce\urel\app.exe"        -"!:\sys\bin\app.exe"
    "C:\Symbian\9.2\S60_3rd_FP1_2\Epoc32\data\z\resource\apps\app.rsc"        -"!:\resource\apps\app.rsc"
    "C:\Symbian\9.2\S60_3rd_FP1_2\Epoc32\data\z\private\10003a3f\apps\app_reg.rsc"    -"!:\private\10003a3f\import\apps\app_reg.rsc"
    "C:\Symbian\9.2\S60_3rd_FP1_2\Epoc32\data\z\resource\apps\app.mif" -"!:\resource\apps\app.mif"
    "C:\progetti\app\data\app.dat" -"!:\data\app\configuration.dat"
    "C:\progetti\app\data\license.dat" -"!:\data\app\license.dat"
    "C:\progetti\app\data\about.properties"-"!:\data\app\about.properties"
    Problem is for the last 3 files in memory card

    Thanks
    Silvia

  12. #12
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,694

    Re: question where save file

    You getDrive method does nothing, that might be the problem. Try
    Code:
    void CMyApp::GetDrive(TDes &aDrive)

  13. #13
    Regular Contributor
    Join Date
    Oct 2006
    Location
    Rome
    Posts
    71

    Re: question where save file

    Quote Originally Posted by wizard_hu_ View Post
    You getDrive method does nothing, that might be the problem. Try
    Code:
    void CMyApp::GetDrive(TDes &aDrive)
    You can try this out too:

    Code:
    static TFileName utilGetAppRootDirectoryL()
    {
        TFileName RootDirectory;
    
        TParsePtrC Parse( CEikonEnv::Static()->EikAppUi()->Application()->AppFullName() );
        RootDirectory = Parse.DriveAndPath();
    
        return RootDirectory;
    }
    
    
    #if defined( __WINS__ )
    	// Path for emulator build. 
    	// We assume that textures are located under z:\pictures.
    	_LIT(KTexPath, "z:\\MYAPP\\");
    	#define APPLICATIONPATH KTexPath
    	#else
    	// Path for HW builds.
    	// We assume that textures are located in the application's root directory
    	#define APPLICATIONPATH Utils::GetAppRootDirectoryL()
    	#endif
    It's found in the "Textureutils.cpp" file, located inside the openGL ES example folder: "SDK_ROOT\S60Ex\OpenGLEx\Utils"



    In bocca al lupo!
    Adriano
    8)

  14. #14
    Regular Contributor
    Join Date
    Aug 2006
    Posts
    252

    Re: question where save file

    Quote Originally Posted by wizard_hu_ View Post
    You getDrive method does nothing, that might be the problem. Try
    Code:
    void CMyApp::GetDrive(TDes &aDrive)
    This method give inside variable aDrive, and drive is correct


    Quote Originally Posted by Tesctassa
    CEikonEnv::Static()->EikAppUi()->Application()->AppFullName()
    Is for second edition right??
    I use 3rd?
    grazie

    Silvia

  15. #15
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,694

    Re: question where save file

    Quote Originally Posted by silviuccia View Post
    This method give inside variable aDrive, and drive is correct
    The method body is OK, but it simply takes a value-type as argument. And value-types become local variables when passed to methods, thus your modifications will be lost when your method completes.

Similar Threads

  1. Error with makesis.exe and creating the .pkg file
    By gramya87 in forum Symbian Tools & SDKs
    Replies: 7
    Last Post: 2007-10-10, 13:53
  2. how to save file & how to save settings?
    By MGvision in forum Mobile Java General
    Replies: 2
    Last Post: 2007-06-13, 13:56

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×