0
我是科尔多瓦的新手,并试图开发Android应用程序,我需要打开相机。但我无法做到。以下是我遵循的方法:无法通过科尔多瓦打开相机
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模拟器构建和打开后相机未打开。请帮助我。在此先感谢