如何资源文件添加到我的PhoneGap项目 [英] How to add resources file to my phonegap project
问题描述
我'使用科尔多瓦LocalNotification-插件来展示一些通知用户。现在,我想要做的是对的通知特定的声音。他们说,添加此
I'am using Cordova LocalNotification-Plugin to show some notification to user . Now what I want to do is to have a specific sound on notification . They said to add this
window.plugin.notification.local.add({声:android.resource://+程序包+ /生/蜂鸣});
window.plugin.notification.local.add({ sound: 'android.resource://' + package_name +/raw/beep});
注:本地声音文件必须被放置到资源文件夹,而不是到资产的文件夹
Note: Local sound files must be placed into the res-folder and not into the assets-folder.
我不知道在哪个res文件夹我应该把我的mp3。如果我试图把它变成主要的资源文件夹,我有:绘制;绘制,华电国际;绘制-LDPI;绘制-MDPI;绘制-xhdpi;价值观; XML文件夹时,我建立了项目,我得到这个错误:
I don't know in which res folder should I put my mp3. And if I try to put it into main res folder where I have : drawable; drawable-hdpi; drawable-ldpi;drawable-mdpi;drawable-xhdpi;values;xml folders when I build the project I get this error:
无效的资源目录名称:C:\用户\等\等\ myprojectname \平台\机器人\ RES /声音
invalid resource directory name: C:\Users\etc\etc\myprojectname\platforms\android\res/sounds
我应该怎么办?
推荐答案
据我了解,你应该把你的声音文件在res /原始文件夹而不是RES /声音(如你在插件调用看到:+ / 原 /嘟嘟)。
As I understand it, you should put your sound file in the res/raw folder instead of res/sounds (as you see in the plugin call : +/raw/beep).
没有/ RES / android的声音文件夹,不适合其他类别DATAS应该放在/ RES /生。 你可以看一下 SDK文档
There is no /res/sounds folder in android, datas that do not fit in other categories should be put in /res/raw. You can have a look at the sdk doc
这篇关于如何资源文件添加到我的PhoneGap项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!