Get application directory with Qt for Android

632 views
Skip to first unread message

faenil

unread,
Dec 12, 2011, 4:34:21 AM12/12/11
to andro...@googlegroups.com
hi guys :)

Is there a way to get application directory in Qt for Android?

I've read many discussions about this subject...

some people suggest writing a function in the JNI wrapper, but with all the things ministro and those other services create, I really don't know where to add that...and, how can I make sure some service won't overwrite that file during project rebuilding? 

some other people suggest using a fixed path (which is not future proof)..

I tried using QDir::homePath and this returns "" on the Trasformer (HOME is reset?)

I also tried using app->applicationDirPath, and get its absolutePath, but that returns "/"...

Is there any way to get my app dir in Qt for Android? :)

thanks in advance :)

faenil

unread,
Dec 12, 2011, 4:46:04 AM12/12/11
to andro...@googlegroups.com
to be more precise, I need the application's directory absolute path, so that I can use it with functions like fopen :)

But I'd like to get that via Qt for Android...

faenil

unread,
Dec 12, 2011, 9:52:55 AM12/12/11
to andro...@googlegroups.com
I have found this ticket https://sourceforge.net/p/necessitas/tickets/113/?page=1

but it seems to be unfixed...

faenil

unread,
Dec 12, 2011, 2:06:36 PM12/12/11
to andro...@googlegroups.com
FIXED it myself :)

Uninstalled Ministro on the tablet and reinstalled it, so that it downloaded the updated version of Qt libs for Android :)

homePath is not empty anymore ;)

Raja Ravi Varma

unread,
Dec 13, 2011, 1:20:33 PM12/13/11
to android-qt
Useful functions to find where the program is searching for files:
qDebug() << app.applicationDirPath();
qDebug() << app.applicationFilePath();
qDebug() << app.libraryPaths();
If there is an option to change the title, mark it as [SOLVED].

faenil

unread,
Dec 13, 2011, 5:33:09 PM12/13/11
to andro...@googlegroups.com
those functions are not working yet on Qt for Android ;)

applicationDirPath is in the feature requests for alpha 4 ;)

Anyway, I used homePath, so I can mark it as solved :)

faenil

unread,
Dec 13, 2011, 5:34:15 PM12/13/11
to andro...@googlegroups.com
I see no options to mark it as solved or change the title though :)
Reply all
Reply to author
Forward
0 new messages