Page 1 of 2 12 LastLast
Results 1 to 20 of 21

Thread: About Creating .sis for Nokia

  1. #1
    Join Date
    Nov 2010
    Posts
    23
    Thanks
    10
    Qt products
    Qt/Embedded
    Platforms
    MacOS X Windows

    Default About Creating .sis for Nokia

    Hai Guys,
    I have a question...
    I'm making a mobile application using a lot of sound (for WAV i used QSound and for MP3 i used phonon) and i dont have Nokia device to test it so i used emulator.
    I have a problem with the emulator because at the emulator, i couldn't find my sound folder so i have to copy the sound folder manually.
    How if i'm going to deploy at device and make .sis program to make sure that all of my sound file is already included at the .sis package? An if .sis package did't contain my sound folder, what should i do?

    p.s i tried to pu the sound in resource file. but my sound size is too big... and a read that we can't put sound to resource file

    thx a lot guys

  2. #2
    Join Date
    Sep 2009
    Location
    Finland
    Posts
    63
    Thanks
    1
    Thanked 22 Times in 19 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: About Creating .sis for Nokia

    How if i'm going to deploy at device and make .sis program to make sure that all of my sound file is already included at the .sis package?
    Please take a look at DEPLOYMENT keyword from the documentation, I have used that technique to add some extra files to sis package.

  3. The following user says thank you to tsp for this useful post:

    ardisaz (1st December 2010)

  4. #3
    Join Date
    Nov 2010
    Posts
    23
    Thanks
    10
    Qt products
    Qt/Embedded
    Platforms
    MacOS X Windows

    Default Re: About Creating .sis for Nokia

    Thanks for your suggestion...
    If i used that technique, will my sound folder at the same directory with the .pro? Because to play the music, i use QCoreApplication::applicationDirPath()+"/sound/guitar.mp3". Will it be the same path if i used that technique?
    thank you very much

  5. #4
    Join Date
    Sep 2009
    Location
    Finland
    Posts
    63
    Thanks
    1
    Thanked 22 Times in 19 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: About Creating .sis for Nokia

    Because to play the music, i use QCoreApplication::applicationDirPath()+"/sound/guitar.mp3". Will it be the same path if i used that technique?
    I think it works because in Symbian devices applicationDirPath returns actually application's private folder (i.e. \private\<uid>) instead of the folder where the executable is (\sys\bin), and private folder is the location where the extra files are deployed.

    I have not used applicationDirPath in my projects instead I have next definition in pro-file:

    # Add level files to sis package
    addFiles.sources = levels/*.tmx
    addFiles.path = levels
    DEPLOYMENT += addFiles

    That means that extra files are deployed to private folder in Symbian i.e. if application is installed to C: -drive then the location of those extra files is c:\private\<uid>\levels\ and in the source code the way to access those files is:
    Qt Code:
    1. QFile file("levels/board.tmx");
    2. if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
    3. return false;
    4. :
    To copy to clipboard, switch view to plain text mode 

    I have a problem with the emulator because at the emulator, i couldn't find my sound folder so i have to copy the sound folder manually
    In case of shadow builds better option would be to ensure that working directory points to correct location. In QtCreator select Projects and then select the run configuration of desktop / simulator etc. and ensure that working directory points to correct location instead of the location of the shadow build.

  6. The following user says thank you to tsp for this useful post:

    ardisaz (1st December 2010)

  7. #5
    Join Date
    Nov 2010
    Posts
    23
    Thanks
    10
    Qt products
    Qt/Embedded
    Platforms
    MacOS X Windows

    Default Re: About Creating .sis for Nokia

    Thx for your answer, i still have some question...

    the path for the "addFiles.sources = levels/*.tmx" and "addFiles.path = levels" is taken from the .pro directory or from C://qt/project/levels? do i just write the code like that or i have to add some included?

    and how to make sure that i have already deployed the extra file at .sis because i don't have nokia device?

    thx a lot dear tsp

  8. #6
    Join Date
    Sep 2009
    Location
    Finland
    Posts
    63
    Thanks
    1
    Thanked 22 Times in 19 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: About Creating .sis for Nokia

    I have all source files (including pro-file) under "game" -folder (the absolute path is actually c:\temp\game) and the level files are in "game\levels" -folder and then in the pro-file there is the deployment part.

    When you build your code to Symbian target you can check from the generated pkg-file what files are in the sis-file to ensure that all files that should be there are there, in my case generated game_template.pkg -file contains line:

    Qt Code:
    1. ; DEPLOYMENT
    2. "/NokiaQtSDK/Symbian/SDK/epoc32/data/z/private/ee097ed6/levels/board.tmx" - "!:\private\ee097ed6\levels\board.tmx"
    To copy to clipboard, switch view to plain text mode 
    and based on that line I know that board.tmx file is in the sis package as well as the executable itself.

  9. The following user says thank you to tsp for this useful post:

    ardisaz (1st December 2010)

  10. #7
    Join Date
    Nov 2010
    Posts
    23
    Thanks
    10
    Qt products
    Qt/Embedded
    Platforms
    MacOS X Windows

    Default Re: About Creating .sis for Nokia

    Wow,, it works!!
    Thank you very much tsp...

  11. #8
    Join Date
    Nov 2010
    Posts
    23
    Thanks
    10
    Qt products
    Qt/Embedded
    Platforms
    MacOS X Windows

    Default Re: About Creating .sis for Nokia

    Im sorry, i can find my file at template.pkg using that deployment technique but the file doesn't included at device (using nokia 5800). Same as friends with other project using database, the database didn't show up.

  12. #9

    Default Re: About Creating .sis for Nokia

    Hi,

    I think You first need to create a .pkg file with directives for creating the sis file. Then you create the sis file using the makesis utility form the SDK.

  13. #10
    Join Date
    Nov 2010
    Posts
    23
    Thanks
    10
    Qt products
    Qt/Embedded
    Platforms
    MacOS X Windows

    Default Re: About Creating .sis for Nokia

    Hi seowebmarketing,

    i'm sorry, but could you please help me explain about create a .pkg file with directives for creating the sis file? thank you very much,,,

  14. #11
    Join Date
    Sep 2009
    Location
    Finland
    Posts
    63
    Thanks
    1
    Thanked 22 Times in 19 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: About Creating .sis for Nokia

    file doesn't included at device
    What do you mean by that? If you create the SIS with the DEPLOYMENT keyword and without it, is the size of the SIS file different?

    If you define the file with DEPLOYMENT keyword and the location is not correct i.e. file cannot be found then you are not able to create SIS file instead error message is shown that the file cannot be found.

    Maybe there are some problems in the way you access the file?

  15. #12
    Join Date
    Nov 2010
    Posts
    23
    Thanks
    10
    Qt products
    Qt/Embedded
    Platforms
    MacOS X Windows

    Default Re: About Creating .sis for Nokia

    Tsp, im sorry if i did't ask my problem clearly enough.

    I guess i had the DEPLOYMENT Stuff inside the .sis package well. Like your code, i got my external files at something like "!:\private\ee097ed6\levels\board.tmx" with this code at mh .pro

    Qt Code:
    1. CONFIG += mobility
    2. MOBILITY =
    3.  
    4. symbian {
    5. TARGET.UID3 = 0xe091ff94
    6. # TARGET.CAPABILITY +=
    7. TARGET.EPOCSTACKSIZE = 0x14000
    8. TARGET.EPOCHEAPSIZE = 0x020000 0x800000
    9.  
    10. mysound.sources = sound\*
    11. mysound.path = \sound
    12. bonang.sources = sound\bonang\*
    13. bonang.path= \sound\bonang
    14. gong.sources = sound\gong\*
    15. gong.path=\sound\gong
    16. jengglong.sources = sound\jengglong\*
    17. jengglong.path= \sound\jengglong
    18. kempul.sources = sound\kempul\*
    19. kempul.path = \sound\kempul
    20. kendang.sources = sound\kendang\*
    21. kendang.path = \sound\kendang
    22. saron.sources = sound\saron\*
    23. saron.path = \sound\saron
    24. gambang.sources = sound\gambang\*
    25. gambang.path = \sound\gambang
    26. DEPLOYMENT += mysound bonang gong jengglong kempul kendang saron gambang
    27. }
    To copy to clipboard, switch view to plain text mode 

    And i guess my mistake is the way i access the file. I used QCoreApplication::ApplicationDirPath() to try access the root of my application so i can added string like ("\levels\board.tmx") to access the file. The complete code is

    Qt Code:
    1. alamat = QCoreApplication::applicationDirPath();
    2. gamelan =
    3. Phonon::createPlayer(Phonon::MusicCategory,
    4. Phonon::MediaSource(alamat+"/sound/gamelan.mp3"));
    To copy to clipboard, switch view to plain text mode 
    is there any mistakes i made?

  16. #13
    Join Date
    Sep 2009
    Location
    Finland
    Posts
    63
    Thanks
    1
    Thanked 22 Times in 19 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: About Creating .sis for Nokia

    I think the problem is in the way you have defined those extra files in the pro-file. You currently define those files as:

    Qt Code:
    1. mysound.sources = sound\*
    2. mysound.path = \sound
    3. :
    To copy to clipboard, switch view to plain text mode 
    That definition means that the path to where the files are deployed in actual device is under the root folder (i.e. !:\sound\...), so instead of that you should define the files as (remove the backslash from path definition):

    Qt Code:
    1. mysound.sources = sound\*
    2. mysound.path = sound
    3. :
    To copy to clipboard, switch view to plain text mode 
    Then those files should be located in the !:\private\<uid>\sound folder and then you should be able to access those files in the way you currently access those.

  17. #14
    Join Date
    Dec 2010
    Posts
    4
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Symbian S60

    Default Re: About Creating .sis for Nokia

    Hi guys, i'm having same problem with ardisaz, the difference is i am using database instead of sound, but I have corrected my code like tsp suggested.
    but my apps still can't access the database. So I tried to make sure the database is in the right place, and it is. The problem came up when I want to open the database

    Here is the code when deploy and accessing the database :

    Qt Code:
    1. database.sources = databases/*.db
    2.   database.path = databases
    3.   DEPLOYMENT += database
    To copy to clipboard, switch view to plain text mode 


    Qt Code:
    1. mDB = QSqlDatabase::addDatabase("QSQLITE");
    2. QString dbName = QCoreApplication::applicationDirPath();
    3. qDebug() << dbName;
    4. mDB.setDatabaseName(dbName+"/databases/juicemania.db");
    5.  
    6. QString test = mDB.databaseName();
    7. QByteArray bb = test.toLatin1();
    8. const char *name2 = bb.data();
    9.  
    10. if (!mDB.open()) {
    11. QMessageBox::critical(0, qApp->tr("Cannot open database"),
    12. qApp->tr(name2), QMessageBox::Cancel);
    13.  
    14. return false;
    15. }
    16. return true;
    To copy to clipboard, switch view to plain text mode 

    Does anyone know what's wrong with my code?

    Really appreciate any help, thx guys

  18. #15
    Join Date
    Sep 2009
    Location
    Finland
    Posts
    63
    Thanks
    1
    Thanked 22 Times in 19 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: About Creating .sis for Nokia

    First, add few checks to your implementation (if you do not have those already)

    Qt Code:
    1. // Ensure QSQLITE driver is supported
    2. if (!QSqlDatabase::drivers().contains("QSQLITE")) { // Print something ... }
    To copy to clipboard, switch view to plain text mode 
    And then you could try next way to access DB file:
    Qt Code:
    1. mDB.setDatabaseName("databases/juicemania.db");
    To copy to clipboard, switch view to plain text mode 
    Because the default folder is your private folder there is no need to access your files via applicationDirPath -method. And last thing is that after failing to open DB, print information about the error using QSqlDatabase::lastError maybe that will reveal more about what is the problem with the open.

    Also in your case return value from
    Qt Code:
    1. QFile::exists("databases/juicemania.db")
    To copy to clipboard, switch view to plain text mode 
    should be true if the file is in the correct location.

  19. The following user says thank you to tsp for this useful post:

    axel07 (8th December 2010)

  20. #16
    Join Date
    Dec 2010
    Posts
    4
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Symbian S60

    Default Re: About Creating .sis for Nokia

    Wow thank you very much tsp

    So I've tried all of your suggestion, and it looks like the problem is with the open, when I printed lastError, it said "unable to open database file, error opening database", do you know what the problem is or maybe you can direct me to any link that I can read, since maybe it start out of topic

    Again, thank you very much

  21. #17
    Join Date
    Sep 2009
    Location
    Finland
    Posts
    63
    Thanks
    1
    Thanked 22 Times in 19 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: About Creating .sis for Nokia

    Sorry I'm running out of ideas . I have one DB application in my Symbian device and I use next piece of code to open the DB file:

    Qt Code:
    1. bool MainWindow::createConnection()
    2. {
    3. qDebug() << Q_FUNC_INFO;
    4.  
    5. // Ensure QSQLITE driver is supported
    6. if (!QSqlDatabase::drivers().contains("QSQLITE"))
    7. return false;
    8.  
    9. bool initDb = !QFile::exists("sqlite.db");
    10. QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
    11. db.setDatabaseName("sqlite.db");
    12.  
    13. if (db.open()) {
    14. if (initDb) {
    15. // Initialise empty DB to contain valid structure
    16. :
    17. :
    To copy to clipboard, switch view to plain text mode 

    The difference (for your use case) is that I do not deploy the DB file instead in the first app start the DB is created (basically all DB structures are done during the first start of the app) and after that I open the existing DB. The location of the sqlite.db file is C:\Private\<uid>\sqlite.db.

    Is there any change you could provide small compilable example (whole project) with the DB file? Will your code work in the simulator i.e. the problem is happening only in the actual device?

  22. #18
    Join Date
    Dec 2010
    Posts
    4
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Symbian S60

    Default Re: About Creating .sis for Nokia

    Hi tsp,

    I've tried to change my code like yours,and my code works in the simulator, the problem is only happening in the device, it found the database but can not open it
    I'm getting frustated at it, do you know why?

    Thank you very much

  23. #19
    Join Date
    Nov 2010
    Posts
    23
    Thanks
    10
    Qt products
    Qt/Embedded
    Platforms
    MacOS X Windows

    Default Re: About Creating .sis for Nokia

    now i can put my sound into the package,

    but how to access my sound?
    Qt Code:
    1. sndBon1 =
    2. Phonon::createPlayer(Phonon::MusicCategory,
    3. Phonon::MediaSource("\\sound\guitar\sound1.wav"));
    To copy to clipboard, switch view to plain text mode 

    that code doesn't work,

    but i found something strange, this code work fine
    Qt Code:
    1. backsound =
    2. Phonon::createPlayer(Phonon::MusicCategory,
    3. Phonon::MediaSource("\\sound\backsound.mp3"));
    To copy to clipboard, switch view to plain text mode 

    is this because the sound format (mp3 or wav) or something else?
    thank you very much

  24. #20
    Join Date
    Apr 2010
    Posts
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: About Creating .sis for Nokia

    the Qt emulator and actual devices are very different.. Even though your code runs solid on emulator does not mean it will run as well on an n97 or n900 (i havent debugged on n8 yet...). Biggest differences to name from memory are the softKey menu options and icon displays.

    You should try to borrow a real device to install and test it on before you deploy it.

Similar Threads

  1. Apple vs Nokia
    By high_flyer in forum General Discussion
    Replies: 2
    Last Post: 30th November 2010, 05:35
  2. Qt installation on Nokia N78
    By Alteros in forum Installation and Deployment
    Replies: 3
    Last Post: 8th November 2010, 14:21
  3. Nokia to cut 1,800 jobs
    By TorAn in forum General Discussion
    Replies: 2
    Last Post: 25th October 2010, 22:16
  4. Nokia Open C++ Download
    By Granty in forum Newbie
    Replies: 6
    Last Post: 19th October 2010, 22:33
  5. Nokia N810
    By QTInfinity in forum Installation and Deployment
    Replies: 1
    Last Post: 6th March 2009, 13:12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.