×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    52

    Help with installation onto a nokia device

    Hi all

    I have tested my app on the simulator without any problems but when i build and run it on the actuall nokia device (Nokia 5800 xpress) the app installs and runs fine but it is not doing sqlite searches.

    I suspect that the sqlite database file i want to use is not being copied over to the device? Can anyone please advise me on how i can resolve this.

    Thanks in advance

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Help with installation onto a nokia device

    Study up on the "DEPLOYMENT" .pro file variable.

  3. #3
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    52

    Re: Help with installation onto a nokia device

    Quote Originally Posted by danhicksbyron View Post
    Study up on the "DEPLOYMENT" .pro file variable.
    Hi Danhicksbyron

    I have added the following to my .pro file but it doesnt seem to work

    Code:
    #-------------------------------------------------
    #
    # Project created by QtCreator 2010-11-17T11:27:35
    #
    #-------------------------------------------------
    
    QT       += core gui\
             += sql\
             += webkit
    
    TARGET = app3
    TEMPLATE = app
    
    
    SOURCES += main.cpp\
            mainwindow.cpp \
            dal.cpp
    
    HEADERS  += mainwindow.h \
             dal.h \
        ui_mainwindow.h
    
    FORMS    += \
        mainwindow.ui
    
    OTHER_FILES += \
        mydb.sqlite \
        images/search.png 
    
    DEPLOYMENT += \
        mydb.sqlite \
        images/search.png
    I do not know much about the installation layout of symbian apps. But am i correct to understand that when an app is installed the executables are copied into /sys/bin

    Therefore if my app is looking for the mydb.sqlite database file in the same directory as itself is the above correct?

  4. #4
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    93

    Re: Help with installation onto a nokia device

    Hi,
    u need to add this...


    symbian{

    addFiles.sources += firstfile.sqlite \
    secondfile.png

    DEPLOYMENT += addFiles
    }

  5. #5
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    52

    Re: Help with installation onto a nokia device

    Quote Originally Posted by marsiliano View Post
    Hi,
    u need to add this...


    symbian{

    addFiles.sources += firstfile.sqlite \
    secondfile.png

    DEPLOYMENT += addFiles
    }

    Hi Marsiliano

    Thank you very much for replying. I have tried you code you suggested and my app still doesnt search the database and none of the images for the buttons are displaying, so this makes me suspect that the db file or png images are not being copied over or not being copied over into the app directory. Anymore ideas you could suggest.

    Thanks

  6. #6
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Help with installation onto a nokia device

    database.sources += mydb.sqlite
    database.path += .
    DEPLOYMENT += database
    images.sources += images/search.png
    images.path += images
    DEPLOYMENT += images

    This will put your database in the application's home directory and the png file in the images subdirectory of that home directory.

  7. #7
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    52

    Re: Help with installation onto a nokia device

    Quote Originally Posted by danhicksbyron View Post
    database.sources += mydb.sqlite
    database.path += .
    DEPLOYMENT += database
    images.sources += images/search.png
    images.path += images
    DEPLOYMENT += images

    This will put your database in the application's home directory and the png file in the images subdirectory of that home directory.
    Thanks for replying, i did what you advised and the images loaded fine but the database search parts of the app dont work, i suspect there is a database file there but its being created by the app so its empty, i suspect the realy database file is going somewhere else, is there anyway i can see the installation directory of the app on the nokia 5800 phone?

  8. #8
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Help with installation onto a nokia device

    How are you referring to the DB file on the phone? You should supply no path with the DB name so long as the file's in the app's home directory.

    And maybe you should list here the DEPLOYMENT section in your .pro for us to look at.

  9. #9
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    52

    Re: Help with installation onto a nokia device

    Quote Originally Posted by danhicksbyron View Post
    How are you referring to the DB file on the phone? You should supply no path with the DB name so long as the file's in the app's home directory.

    And maybe you should list here the DEPLOYMENT section in your .pro for us to look at.
    Code:
    QT       += core gui\
             += sql\
             += webkit
    
    TARGET = app3
    TEMPLATE = app
    
    
    SOURCES += main.cpp\
            mainwindow.cpp \
            dal.cpp
    
    HEADERS  += mainwindow.h \
             dal.h \
        ui_mainwindow.h
    
    FORMS    += \
        mainwindow.ui
    
    OTHER_FILES += \
        images/search.png \
        mydb.sqlite
    
    symbian {
    database.sources += mydb.sqlite
    database.path += .
    DEPLOYMENT += database
    images.sources += images/*
    images.path += images
    DEPLOYMENT += images
    }

    Thanks for such a quick response. The images are displaying fine but the db is not being searched by the app. I have a line in the open db() that will display a message if the db wasnt found so this must mean the "mydb.sqlite" file is in the app root but may be empty?

    I am opening the db via the following

    Code:
        db = QSqlDatabase::addDatabase("QSQLITE");
        db.setDatabaseName("mydb.sqlite");
        return db.open();
    Last edited by ginda1; 2010-12-10 at 00:49.

  10. #10
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Help with installation onto a nokia device

    Well, that looks like it should work. Sqlite will create the DB if none exists, so it almost always executes the open() successfully, even if the DB is not found.

    You can do db.tables() and print the result (or just the count), to determine if the DB is really there.

    You can also do something like this
    Code:
        QFileInfo info(dbName);
        QMessageBox::information(0, "", QString("File exists: %1").arg(info.exists()));
        QMessageBox::information(0, "", QString("Path: %1").arg(info.absoluteFilePath()));
        QMessageBox::information(0, "", QString("Size: %1").arg(info.size()));
    to determine if the file is there (before opening the DB).

    And then you can do something like this
    Code:
     
            QString absoluteName;
    	absoluteName = QDir::toNativeSeparators(info.absoluteFilePath());
    to convert the file name into an absolute path that Sqlite will accept.

    (And I suspect I've just figured out what's wrong. Did you install you app on other than the C: drive? Sqlite doesn't like that, unless you use the absoluteFilePath trick above to get the full path name.)

  11. #11
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    52

    Re: Help with installation onto a nokia device

    Quote Originally Posted by danhicksbyron View Post
    Well, that looks like it should work. Sqlite will create the DB if none exists, so it almost always executes the open() successfully, even if the DB is not found.

    You can do db.tables() and print the result (or just the count), to determine if the DB is really there.

    You can also do something like this
    Code:
        QFileInfo info(dbName);
        QMessageBox::information(0, "", QString("File exists: %1").arg(info.exists()));
        QMessageBox::information(0, "", QString("Path: %1").arg(info.absoluteFilePath()));
        QMessageBox::information(0, "", QString("Size: %1").arg(info.size()));
    to determine if the file is there (before opening the DB).

    And then you can do something like this
    Code:
     
            QString absoluteName;
    	absoluteName = QDir::toNativeSeparators(info.absoluteFilePath());
    to convert the file name into an absolute path that Sqlite will accept.

    (And I suspect I've just figured out what's wrong. Did you install you app on other than the C: drive? Sqlite doesn't like that, unless you use the absoluteFilePath trick above to get the full path name.)

    I installed the app to the memory card which would mean its other than the c drive, do you think that is causing the problem?

  12. #12
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    52

    Re: Help with installation onto a nokia device

    I have also tried to install the sis file to the phones memory and it also doesnt work there either. I 100% know that the db is being included in the sis build as the size of the sis file shows it. I will try and absolute path example you advised.

  13. #13
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    52

    Re: Help with installation onto a nokia device

    Hi again

    I have tried to debug with the code suggested, below was the output.

    File exists: 1
    File path: C:/Private/e365697f/mydb.sqlite
    File size: 50059264


    Note - Yes the db is quite big as i have filled it with loads of test data.

  14. #14
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    52

    Re: Help with installation onto a nokia device

    I have also done same for the images as they are working and they are as expected.

    File exists: 1
    File path: C:/Private/e365697f/images/search.png
    File size: 6385

    So the mydb.sqlite is in the correct place, so what am i doing wrong? The app works fine in the simulator but not on phone? sqlite3 is installed on the device along with Qt so i am not sure what else it could be?

  15. #15
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Help with installation onto a nokia device

    Quote Originally Posted by ginda1 View Post
    I installed the app to the memory card which would mean its other than the c drive, do you think that is causing the problem?
    Definitely. Copy the logic I provided to create the "absoluteName" (to be provided to setDatabaseName()) and you'll be good to go.

    [Well, maybe not, based on your later posts.]

Similar Threads

  1. Problem in installation jad on device
    By mohit28garg in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2010-01-11, 17:39
  2. Installation of .lib files on Device
    By ahmadn in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 3
    Last Post: 2009-07-16, 19:01
  3. Real device installation
    By afka in forum Mobile Java General
    Replies: 3
    Last Post: 2007-02-28, 12:42
  4. Please help, installation on device
    By Defender666 in forum Mobile Java General
    Replies: 3
    Last Post: 2004-04-04, 10:56
  5. Installation on device
    By Nokia_Archive in forum Mobile Java General
    Replies: 1
    Last Post: 2002-05-24, 00:28

Posting Permissions

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