[Android-development] Attempting a port to Android - Notes and Suggestions
Eskil Abrahamsen Blomfeldt
eskil.abrahamsen-blomfeldt at digia.com
Mon Feb 25 15:52:00 CET 2013
On 02/25/2013 03:44 PM, Patricia Aas wrote:
>> I think this is a down-side of specifying file system paths in the QMLs
>> explicitly.
>
>
> But I don't see a way I can keep the qmls as qrc's and not have the
> images as qrc's and have cross platform code. Am I missing something?
You could have the QML in the assets as well (which would mean disabling
the RESOURCES += on android in the .pro file). Then relative paths would
work inside the QML, but the file:/ paths would still point to the file
system.
I noted this on IRC, but I'll repeat it here, to make sure it's archived
along side the rest:
Maybe it would make sense to
1. Make a portability flag of some sort which would cause all relative
file system paths to be relative to the assets:/ prefix, since this is
the expected location for the application to find its files. It does
sound a little ad hoc though.
2. Add an application: scheme which would always resolve to the
application's working directory, whether that's inside the bundle like
on Android, next to the executable like on Windows/Linux or wherever it
is on Mac (foo.app/Contents/Resources?), etc.
-- Eskil
More information about the Android-development
mailing list