问题描述
在新的英特尔XDK ....使用摄像头和缓存对象构建小的应用程序
- 应用曾在模拟器......但是当我在Android手机试图测试..程序开始,但我cannt使用它...按钮donnot显示哪些应该做的任何影响!
注意:在Android应用程序做所有的效果不使用intel.xdk
这是什么问题....非常感谢
document.addEventListener\r
(intel.xdk.camera.picture.add,picOk);\r
\r
功能takePic(){\r
intel.xdk.camera.takePicture(100,假的,JPG);\r
}\r
功能importpic(){\r
intel.xdk.camera.importPicture();\r
}\r
功能picOk(PIC){\r
如果(pic.success ==真)\r
{\r
VAR imgSrc = intel.xdk.camera.getPictureURL(pic.filename);\r
\r
$('#内容)追加。(< IMG SRC ='+ imgSrc +'/>中);\r
}\r
其他{\r
如果(pic.message =未定义的!)警报(pic.message);\r
否则警报(错误十朱图片);\r
}\r
}
\r
所以,问题是我们没有添加摄像机插件。这一步是不以任何特定的教程,并可能(目前使用建1494)是英特尔XDK的一个新的组成部分。
要解决这个问题去的项目(在左上角链接),然后点击您的项目。在Cordovia 3.X混合移动应用程序设置部分中有一段名为包含插件。在本节中有标准科尔多瓦插件,并再次下权的摄像头插件特色和放大器;定制插件科尔多瓦/英特尔XDK插件。检查这两个,然后重新启动英特尔XDK。这种固定对我来说。
new in Intel-XDK .... build small app using camera and cache objects
- app worked at Emulator ... but when i tried test it on android mobile .. app started but i cannt use it ... buttons donnot show any effect which should do it !!!note : app on android do all effects which do not use intel.xdkwhat is the problem .... thanks a lot
document.addEventListener
("intel.xdk.camera.picture.add",picOk);
function takePic(){
intel.xdk.camera.takePicture(100,false,"jpg");
}
function importpic(){
intel.xdk.camera.importPicture();
}
function picOk(pic){
if(pic.success==true)
{
var imgSrc=intel.xdk.camera.getPictureURL(pic.filename);
$('#content').append("<img src='"+imgSrc+"' />");
}
else{
if(pic.message!=undefined) alert(pic.message);
else alert("error to toake picture");
}
}
So the problem is we didn't add the "Camera" plugin. This step isn't specified in any tutorial and may be a new part of Intel XDK (currently using build 1494).
To fix this go to Projects (link at top left) and click on your project. Under the "Cordovia 3.X Hybrid Mobile App Settings" section there is a section called "included Plugins". In this section there is a Camera plugin under "Standard Cordova Plugins" and again on the right under "Featured & Custom Cordova Plugins / Intel XDK Plugins". Check both of these and then restart Intel XDK. This fixed it for me.
这篇关于英特尔XDK Android上无法工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!