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

Android™ Runtime Development

Reply
Visitor
Posts: 1
Registered: ‎04-08-2013
My Device: developer
My Carrier: developer

Hide app images/audio files from stock Pictures/Music app

We've ported over an android app that makes use of a .nomedia file to prevent our images/audio files that our app downloads from appearing in the stock image gallery/music player.  It doesn't appear that .nomedia is not being recognized by the BB10 android runtime?  We've also tried using .metadata_never_index but that doesn't seem to work either.  Any suggestions? 

Retired
Posts: 264
Registered: ‎01-08-2013
My Device: BlackBerry 10 Dev Alpha B
My Carrier: Bell

Re: Hide app images/audio files from stock Pictures/Music app

Hey there,

 

We did have an issue open for .nomedia support which should be resolved and available in 10.1

 

Have you tested against the 10.1 build?

 

    Justin

Justin Jasmann | Android Application Development Consultant
Developer Relations
developer.blackberry.com
Developer
Posts: 325
Registered: ‎10-01-2012
My Device: Dev Alpha C, Playbook 32 GB
My Carrier: BleskMobil

Re: Hide app images/audio files from stock Pictures/Music app

Is somewhere official spec how to use these files and what metadata file is recommended?

--------------------------------------------------------------------------------------------
-- My Blackberry 10 app at http://blackberry.hubalek.net
-- My Android apps at http://android.hubalek.net
Retired
Posts: 264
Registered: ‎01-08-2013
My Device: BlackBerry 10 Dev Alpha B
My Carrier: Bell

Re: Hide app images/audio files from stock Pictures/Music app

The only information on .nomedia is on the Android Developer website under Storage Options as a side note.

 

It reads:

 

"

Hiding your files from the Media Scanner

Include an empty file named.nomedia in your external files directory (note the dot prefix in the filename). This will prevent Android's media scanner from reading your media files and including them in apps like Gallery or Music.

"

 

I believe .metadata_never_index is something implemented by Apple on a few of their devices.

 

    Justin

Justin Jasmann | Android Application Development Consultant
Developer Relations
developer.blackberry.com
Developer
Posts: 325
Registered: ‎10-01-2012
My Device: Dev Alpha C, Playbook 32 GB
My Carrier: BleskMobil

Re: Hide app images/audio files from stock Pictures/Music app

I tested all suggestions and only putting dot at the beginning of the directory name helped.

All other no index flags seems to be ignored on BlackBerry 10.0.10 and 10.1
--------------------------------------------------------------------------------------------
-- My Blackberry 10 app at http://blackberry.hubalek.net
-- My Android apps at http://android.hubalek.net
Retired
Posts: 264
Registered: ‎01-08-2013
My Device: BlackBerry 10 Dev Alpha B
My Carrier: Bell

Re: Hide app images/audio files from stock Pictures/Music app

Have you closed/reopened the media app after adding the .nomedia? 

 

If you have files showing up in the app, then add the .nomedia, it may not re-index until you restart the device.

 

    Justin

Justin Jasmann | Android Application Development Consultant
Developer Relations
developer.blackberry.com
Developer
Posts: 325
Registered: ‎10-01-2012
My Device: Dev Alpha C, Playbook 32 GB
My Carrier: BleskMobil

Re: Hide app images/audio files from stock Pictures/Music app

@jjasmann I didn't try it but it is good to know. Thanks.

Would it be possible to put this info into file system documentation at https://developer.blackberry.com/cascades/documentation/device_platform/filesystem/
--------------------------------------------------------------------------------------------
-- My Blackberry 10 app at http://blackberry.hubalek.net
-- My Android apps at http://android.hubalek.net