intel xdk not work on android

2019-08-07 06:53发布

问题:

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.xdk what 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");
              } 
            }

回答1:

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.