2015-09-21 31 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項目選項卡,然後點擊加號「插件」,然後點擊「包括插件」,然後選中了「相機」複選框

相關問題