0
私はCordovaを初めて使い、カメラを開く必要のあるAndroid用のアプリを開発しようとしています。しかし、私はできません。以下は、私が従ったアプローチです:Cordovaでカメラを開くことができません
var app = {
initialize: function() {
this.bindEvents();
},
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
onDeviceReady: function() {
app.receivedEvent('deviceready');
document.getElementById('camera').addEventListener('click',function(e){
navigator.camera.getPicture(onSuccess, onFail,{
quality: 50,
destinationType: Camera.DestinationType.DATA_URL});})
},
function onSuccess(imageData){
var image=document.getElementById('myImage');
image.src="data:img/jpeg;base64,"+imageData;
}
function onFail(message){
alert('Failed because: '+message);
}
receivedEvent: function(id) {
console.log(id)
}
};
app.initialize();
Androidエミュレータでビルドして開いた後、カメラが開かれていません。親切に私を助けてください。事前のおかげで