res / drawable文件在英特尔XDK [英] res/drawable files in Intel XDK

查看:158
本文介绍了res / drawable文件在英特尔XDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在xdk传输文件到android / res / drawable文件夹?



我有以下文件:

  src / android / drawable / noti_icon.png 
www / src / android / drawable / noti_icon.png

我已经尝试了在intelxdk.config.additions.xml文件中包含以下行:

 < resource-file src =src / android / res / drawable / noti_icon.pngtarget =res / drawable / noti_icon.png/& 
< resource-file src =src / android / res / drawable / noti_icon.pngtarget =res / drawable-hdpi / noti_icon.png/>
< resource-file src =src / android / res / drawable / noti_icon.pngtarget =res / drawable-xhdpi / noti_icon.png/>

< resource-file src =src / android / res / drawable / noti_icon.pngtarget-dir =res / drawable/>
< resource-file src =src / android / res / drawable / noti_icon.pngtarget-dir =res / drawable-hdpi/>
< resource-file src =src / android / res / drawable / noti_icon.pngtarget-dir =res / drawable-xhdpi/>

< resource-file src =src / android / res / drawable / noti_icon.pngtarget =platforms / android / res / drawable / noti_icon.png/>
< resource-file src =src / android / res / drawable / noti_icon.pngtarget =platforms / android / res / drawable-hdpi / noti_icon.png/>
< resource-file src =src / android / res / drawable / noti_icon.pngtarget =platforms / android / res / drawable-xhdpi / noti_icon.png/>

< resource-file src =src / android / res / drawable / noti_icon.pngtarget-dir =platforms / android / res / drawable/>
< resource-file src =src / android / res / drawable / noti_icon.pngtarget-dir =platforms / android / res / drawable-hdpi/>
< resource-file src =src / android / res / drawable / noti_icon.pngtarget-dir =platforms / android / res / drawable-xhdpi/>


< source-file src =src / android / res / drawable / noti_icon.pngtarget =res / drawable / noti_icon.png/>
< source-file src =src / android / res / drawable / noti_icon.pngtarget =res / drawable-hdpi / noti_icon.png/>
< source-file src =src / android / res / drawable / noti_icon.pngtarget =res / drawable-xhdpi / noti_icon.png/>

< source-file src =src / android / res / drawable / noti_icon.pngtarget-dir =res / drawable/>
< source-file src =src / android / res / drawable / noti_icon.pngtarget-dir =res / drawable-hdpi/>
< source-file src =src / android / res / drawable / noti_icon.pngtarget-dir =res / drawable-xhdpi/>

< source-file src =src / android / res / drawable / noti_icon.pngtarget =platforms / android / res / drawable / noti_icon.png/>
< source-file src =src / android / res / drawable / noti_icon.pngtarget =platforms / android / res / drawable-hdpi / noti_icon.png/&
< source-file src =src / android / res / drawable / noti_icon.pngtarget =platforms / android / res / drawable-xhdpi / noti_icon.png/>

< source-file src =src / android / res / drawable / noti_icon.pngtarget-dir =platforms / android / res / drawable/>
< source-file src =src / android / res / drawable / noti_icon.pngtarget-dir =platforms / android / res / drawable-hdpi/>
< source-file src =src / android / res / drawable / noti_icon.pngtarget-dir =platforms / android / res / drawable-xhdpi/>

但没有任何反应。它应该工作还是它是错误?我能做什么?我需要此图标作为我的本地通知。

解决方案

我beilive这个问题要求得到一个令人讨厌的白色图标的cordova应用程序收到推送通知时。



一个无痛的方法是使用这个流行的插件注册和接收推送通知: https://github.com/phonegap/phonegap-plugin-push



然后只需将图标放在应用程序文件夹中的某个位置,并从推送服务器发送消息时,通过image属性指定图标即可:

  {
registration_ids:[my device id],
data:{
title:Large Icon,
message:从资源文件夹加载,
image:www / image / logo.png
}
}
pre>

您可以参考以下链接:
https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/PAYLOAD.md


Is there a way in xdk to transfer files to the android/res/drawable folder?

I've the following files:

src/android/drawable/noti_icon.png
www/src/android/drawable/noti_icon.png

And I've tryed it by including the following lines in my intelxdk.config.additions.xml file

<resource-file src="src/android/res/drawable/noti_icon.png" target="res/drawable/noti_icon.png"/>
<resource-file src="src/android/res/drawable/noti_icon.png" target="res/drawable-hdpi/noti_icon.png"/>
<resource-file src="src/android/res/drawable/noti_icon.png" target="res/drawable-xhdpi/noti_icon.png"/>

<resource-file src="src/android/res/drawable/noti_icon.png" target-dir="res/drawable"/>
<resource-file src="src/android/res/drawable/noti_icon.png" target-dir="res/drawable-hdpi"/>
<resource-file src="src/android/res/drawable/noti_icon.png" target-dir="res/drawable-xhdpi"/>

<resource-file src="src/android/res/drawable/noti_icon.png" target="platforms/android/res/drawable/noti_icon.png"/>
<resource-file src="src/android/res/drawable/noti_icon.png" target="platforms/android/res/drawable-hdpi/noti_icon.png"/>
<resource-file src="src/android/res/drawable/noti_icon.png" target="platforms/android/res/drawable-xhdpi/noti_icon.png"/>

<resource-file src="src/android/res/drawable/noti_icon.png" target-dir="platforms/android/res/drawable"/>
<resource-file src="src/android/res/drawable/noti_icon.png" target-dir="platforms/android/res/drawable-hdpi"/>
<resource-file src="src/android/res/drawable/noti_icon.png" target-dir="platforms/android/res/drawable-xhdpi"/>


<source-file src="src/android/res/drawable/noti_icon.png" target="res/drawable/noti_icon.png"/>
<source-file src="src/android/res/drawable/noti_icon.png" target="res/drawable-hdpi/noti_icon.png"/>
<source-file src="src/android/res/drawable/noti_icon.png" target="res/drawable-xhdpi/noti_icon.png"/>

<source-file src="src/android/res/drawable/noti_icon.png" target-dir="res/drawable"/>
<source-file src="src/android/res/drawable/noti_icon.png" target-dir="res/drawable-hdpi"/>
<source-file src="src/android/res/drawable/noti_icon.png" target-dir="res/drawable-xhdpi"/>

<source-file src="src/android/res/drawable/noti_icon.png" target="platforms/android/res/drawable/noti_icon.png"/>
<source-file src="src/android/res/drawable/noti_icon.png" target="platforms/android/res/drawable-hdpi/noti_icon.png"/>
<source-file src="src/android/res/drawable/noti_icon.png" target="platforms/android/res/drawable-xhdpi/noti_icon.png"/>

<source-file src="src/android/res/drawable/noti_icon.png" target-dir="platforms/android/res/drawable"/>
<source-file src="src/android/res/drawable/noti_icon.png" target-dir="platforms/android/res/drawable-hdpi"/>
<source-file src="src/android/res/drawable/noti_icon.png" target-dir="platforms/android/res/drawable-xhdpi"/>

But nothing happens. Should it work or is it all wrong? What can I do? I need this icon for my local notifications.

解决方案

I beilive this question is asked to get over the nasty white icon of a cordova app when it receive a push notification.

One painless way is to use this popular plugin to register and receive push notifications: https://github.com/phonegap/phonegap-plugin-push

Then just simply put the icon somewhere in your apps's folder and when sending the message from your push server, specify the icon by the image property like this:

{
    "registration_ids": ["my device id"],
    "data": {
        "title": "Large Icon",
        "message": "Loaded from assets folder",
        "image": "www/image/logo.png"
    }
}

You can reffer to this link: https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/PAYLOAD.md

这篇关于res / drawable文件在英特尔XDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆