Adding a (sound) file to package/apk.

// Expert user has replied.
R Remco van 't Land 3 years 6 months ago
5 2 0

Hi all,

We've been trying to add some specific sound files to our package and can't seem to figure out why it doesn't work.

We've added them to this folder: C:\MotorolaRhoMobileSuite4.1.1\ruby\lib\ruby\gems\1.9.1\gems\rhoelements-4.1.11\libs\rhoelementsext\ext\android\adds\res\raw

And while I see them listed during the compile and they show up in the APK:
RET:  2406888 res/raw/fd_topfade.png (OK)
RET:  2407176 res/raw/fd_transferimage.png (OK)
RET:  2412052 res/raw/fout.wav (OK)
RET:  2437288 res/raw/goed.wav (OK)
RET:  2452776 res/raw/header.png (OK)
RET:  2455300 res/raw/jsobjects.js (OK)
RET:  2546852 res/raw/leeg.wav (OK)
RET:  2590984 res/raw/logo.gif (OK)
RET:  2593892 res/raw/menu.html (OK)
RET:  2603552 res/raw/moto.png (OK)
RET:  2605804 res/raw/pressed_item.png (OK)
They're not available after installing the APK on an MC40.

Is there some manifest I have to add them to to get them installed on the device with the package?

Thanks in advance!

Please Register or Login to post a reply

2 Replies

R Robert Galvin

Why are you adding them to: : C:\MotorolaRhoMobileSuite4.1.1\ruby\lib\ruby\gems\1.9.1\gems\rhoelements-4.1.11\libs\rhoelementsext\ext\android\adds\res\raw?

How are you trying to access them once the APK is installed?

You should consider adding them to the project www folder and then using the Rho.Application helper APIs

     var appFolder = Rho.Application.appBundleFolder;
     var appsBundleFolder = Rho.Application.appsBundleFolder;
     var databaseBlobFolder = Rho.Application.databaseBlobFolder;
     var publicFolder = Rho.Application.publicFolder;
     var userFolder = Rho.Application.userFolder;

R Remco van 't Land

Hi Rob,

It was the only place where I saw files that I found back on the device, so I was hoping that adding other files there would also be placed on the device.

Where can I find the www folder? Please note that I'm using Rho 4.1.1 and have very little experience with RhoStudio itself; I mainly use commandline at the moment.

Thanks in advance!

CONTACT
Can’t find what you’re looking for?