2015-09-07 41 views
1

navigator.camera.getPicture無法與Android設備navigator.camera.getPicture不能與Android設備

工作是工作讓錯誤在這樣

[phonegap] starting app server... 
[phonegap] listening on 192.168.1.45:3000 
[phonegap] 
[phonegap] ctrl-c to stop the server 
[phonegap] 
[phonegap] 200 /__api__/appzip 
[phonegap] 200 /socket.io/socket.io.js 
[phonegap] 200 /socket.io/?EIO=2&transport=polling&t=1441601075309-0 
[phonegap] 200 /socket.io/?EIO=2&transport=polling&t=1441601075345-1&sid=TbhXr9L 
76eLIKtCWAAAA 
[phonegap] 200 /socket.io/?EIO=2&transport=polling&t=1441601075367-2&sid=TbhXr9L 
76eLIKtCWAAAA 
[phonegap] [console.log] Event Called 

回答

1

請分享您的代碼,您使用此命令行函數,並且你還在config.xml中添加了相同的插件?如果沒有插件

<gap:plugin name="org.apache.cordova.camera" /> 

和代碼使用的相機是

navigator.camera.getPicture(onSuccess, onFail, { quality: 20,correctOrientation : true,targetWidth: 700, 
    targetHeight: 700, 
    destinationType: Camera.DestinationType.DATA_URL 
}); 

請結帳,你失去了一些東西?

+0

在我的情況下,我打電話給getPicture,但是什麼都發生了...在瀏覽器中,當然,它給了我錯誤,但是在真實設備中,我沒有任何反饋 –

+1

您是否在初始化時調用了設備你的應用程序?如果沒有,那麼這樣做 – sunil

+0

是的,我打電話給deviceReady但在這個功能裏面沒有任何關於相機的代碼....我在這裏錯過了什麼嗎? –

相關問題