简体   繁体   English

在Cordova自定义插件中回调图片

[英]Callback a picture in Cordova custom Plugin

I am trying to make a custom plugin for Cordova that will be used for Android. 我正在尝试为Cordova制作一个自定义插件,该插件将用于Android。 Now, in the src code of the plugin for Android, I have a drawable (icon) which I want to pass it to the Cordova side (The plugin returns a name and its drawable). 现在,在Android插件的src代码中,我有一个drawable(图标),我想将其传递给Cordova端(该插件返回一个名称和其drawable)。

So far, the best idea that I could find was to save the image in a temporary folder and give the path back to cordova side. 到目前为止,我能找到的最好的主意是将图像保存在一个临时文件夹中,并提供返回科尔多瓦一侧的路径。 However, since it is never a big picture has anyone any other suggestions to give the drawable as a callback to Javascript side? 但是,由于它从来都不是一个大图,是否还有其他建议将可绘制对象作为对Javascript的回调?

Thanks all 谢谢大家

Someone contributed to the plugin for Cordova I have wrote, and added this functionality. 有人为我编写的Cordova插件做出了贡献,并添加了此功能。 But the way it was implemented was saving the image to sd card in the plugin and reading it from cordova. 但是它的实现方式是将图像保存到插件中的sd卡中并从cordova读取它。

You can check it at https://github.com/jmrezayi2/Applist 您可以在https://github.com/jmrezayi2/Applist上进行检查

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM