Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Contributor
bbkeeper
Posts: 41
Registered: ‎04-27-2010
My Device: Z10
My Carrier: VIettel

Re: Problem with imageSource coming from appdata directory on dev alpha c

Hey Garette, The project contains 3 things, Audio with MediaPlayer, Image with ImageView and Audio with NotificationDialog (Sorry i include it here too for reporting)

 

http://www.mediafire.com/?sjo7afj3glsqkk9

 

1. The Audio with MediaPlayer works on 10.1.0.1485 since I use file picker. But my other app uses QDir, QFile, QFileInfoList, QFileInfo and 

canonicalFilePath() to obtain the URL and it doesn't work. Sorry i don't have time to rewrite but basically when i debugging, I see in console at the step:

 

MediaPlayer::setSourceUrl: url=QUrl("/accounts/1000/shared/music/01. Escape.wav") 

 

The MediaPlayer insert the "asset://" at the beginning of the QUrl and that's why it looks for the song in the assets folder and thus it failed to play since the song is not in assets folder.

 

2. ImageView: Doesn't work, doesn't show the Image, It shows on 10.0.

 

3. NotificationDialog sound: If the audio file name contains space, it doesn't play, in stead, it will play the default tone Essential. If you try the audio file without space in filename, it will play perfectly.

 

Please help testing and reporting.

 

Thank you so much Garette.

 

PS: Let me know if you need anything else.

 

---
More applications/games here: http://appworld.blackberry.com/webstore/vendor/14299/
louis.keeper@gmail.com
haitt@viethop.net
http://blackberryvietnam.net
http://viethop.com
Please use plain text.
BlackBerry Development Advisor (Retired)
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Problem with imageSource coming from appdata directory on dev alpha c

Thanks! I reproduced the image issue and was actually able to also replicate the issue reported by 

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.
BlackBerry Development Advisor (Retired)
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Problem with imageSource coming from appdata directory on dev alpha c

As an update, I've found out that this issue should only occur if using SDK version 10.1 or higher.

 

Working now to determine the best course of action forward. Will keep you posted.

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.
Developer
rnickel
Posts: 62
Registered: ‎10-29-2008
My Device: 9800
My Carrier: Rogers

Re: Problem with imageSource coming from appdata directory on dev alpha c

Thanks Garett!

Please use plain text.
Developer
gyubok
Posts: 520
Registered: ‎10-08-2009
My Device: Bold 9900
My Carrier: Telus

Re: Problem with imageSource coming from appdata directory on dev alpha c

I'm currently using SDK version 10.1.0.1483 and the error is present.

 

Will the next iteration of the SDK fix the issue?

Please use plain text.
Developer
gyubok
Posts: 520
Registered: ‎10-08-2009
My Device: Bold 9900
My Carrier: Telus

Re: Problem with imageSource coming from appdata directory on dev alpha c

Sorry, the solution to my problem was to add "file:///" in front of the picture path.

 

It's weird since when i use C++ to set the imagesource, I don't need that prefix

Please use plain text.
Contributor
bbkeeper
Posts: 41
Registered: ‎04-27-2010
My Device: Z10
My Carrier: VIettel

Re: Problem with imageSource coming from appdata directory on dev alpha c

C++ might not need that. Thanks for the report.

---
More applications/games here: http://appworld.blackberry.com/webstore/vendor/14299/
louis.keeper@gmail.com
haitt@viethop.net
http://blackberryvietnam.net
http://viethop.com
Please use plain text.
BlackBerry Development Advisor (Retired)
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Problem with imageSource coming from appdata directory on dev alpha c

Update


Hi everyone,

 

So after digging through this it seems that referencing the absolute path from QML without using file:// was a bug that should not have occurred. As of 10.1 this has been changed so it is no longer supported.

 

What does this all mean?

If your app was compiled with a version of the SDK pre-10.1 it will continue to work as-is, no need to prefix your absolute paths with "file://", though this would be good to do anyways.

Also, if setting the imageSource/file reference from C++ you do not need to prefix the path with "file://" because C++ does not have the same parenting as in a QML file, QML treats references as relative whereas C++ wills ee them as absolute.

 

If using 10.1 SDK or higher and setting any resource paths within QML you will need to prefix the URI with "file://", this will include file paths returned from the FilePicker control.

 

I am submitting a feature request for the FilePicker so that you will have the option to decide whether the returned path begins with "file://" or not. This will maintain backwards compatibility and also allow devs to easily grab a path if assigning to a resource or without this prefix if used for some other purpose where it is not desired/needed.

 

 

 

I hope that clarifies the entire situation as it stands. If I missed anything or you have any questions pleasse let me know.

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.
BlackBerry Development Advisor (Retired)
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Problem with imageSource coming from appdata directory on dev alpha c

This has not been KBd:

http://supportforums.blackberry.com/t5/Cascades-Development-Knowledge/Unable-to-get-asset-error-when...

 

Working to get docs and release notes updated to more overtly explain this change.

 

Thanks to all in the thread for helping narrow this one down!

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.