2015-09-21 28 views
0

当我测试我的相机项目作为USB连接设备一切正常。现在我决定使用intel xdk构建应用程序来生成apk文件。在我的设备上构建并安装apk后,单击相机按钮,不会启动任何事件。 这是我的控制器:科尔多瓦相机不能在安卓手机与英特尔xdk构建apk后工作

.controller("IController", function($scope, $cordovaCamera) { 
$scope.takePicture = function() { 
    var options = { 
     quality : 75, 
     destinationType : Camera.Dest 

inationType.DATA_URL, 
       sourceType : Camera.PictureSourceType.CAMERA, 
       allowEdit : false, 
       encodingType: Camera.EncodingType.JPEG, 
       targetWidth: 350, 
       targetHeight: 350, 
       popoverOptions: CameraPopoverOptions, 
       correctOrientation: true, 
       saveToPhotoAlbum: false 
      }; 

      $cordovaCamera.getPicture(options).then(function(imageData) { 
       $scope.imgURI = "data:image/jpeg;base64," + imageData; 
      }, function(err) { 
       // An error occured. Show a message to the user 
      }); 
     } 
    }); 

这是我的索引:

<ion-content ng-controller="IController"> 
    <div class="item item-image"> 
    <img ng-show="imgURI !== undefined" ng-src="{{imgURI}}" style="max-width: 40%"> 
    <img ng-show="imgURI === undefined" ng-src="http://placehold.it/300x300" style="max-width: 100%"> 
    </div> 
    <div class="button-bar"> 
    <button ng-click="takePicture()" class="button icon-left ion-android-camera customIconSound">Take photo</button> 
     <button ng-click="takePicture()" class="button button-outline icon-right ion-home customIconSound">Gallery!</button> 
    </div> 
</ion-content> 

请我缺少什么。谢谢

回答

0

我能够解决我的问题后,大量尝试不同的事情使用这种方法。我点击了XDK项目选项卡,然后点击加号“插件”,然后点击“包括插件”,然后选中了“相机”复选框

相关问题