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>
請我缺少什麼。謝謝