How to access Music folder in Windows Phone 8.1?
-
I'm trying find out the way to access music folder in windows phone 8.1 then read file by QFile, and after some days searching on the web but still no answer. Anyone did this?
Thanks! -
Hi and welcome to devnet,
I don't have a Windows Phone to verify but are you using QStandardPaths with MusicLocation for that ?
-
@SGaist yes, I have tried it as below:
QStringList musicPaths = QStandardPaths::standardLocations(QStandardPaths::MusicLocation);
QMessageBox::information( 0, "info", musicPaths.first(), QMessageBox::Ok);
but show empty path, I think QStandardPaths does not work on WP8.1 (audio too)
I'm thinking about write one Windows Runtime Component in c++ and use with Qt, but I don't know how to deploy my dll along with Qt to target. I have import mydll.lib in .pro file but it still not work (dll was not found when run target). -
You have the deployment guide here that should help you
-
You also need to set a capability to have access to the Music library.
Even after that, there might be some additional issues depending on what you want to achieve. You can check the bugtracker for items about this topic.
-
I have not used Qt on WinRT for a while but as far as I remember direct access (without using a file picker) will not work due to sandboxing. WinRT uses StorageFile objects (instead of FILE stuff known from C) and Qt caches these StorageFile handlers internally but only after using a picker.