Category Archives: android-camera

Cordova camera plugin not working in android mobile but working in emulator

I have developed an app to test the camera open in android mobiles, I have followed the cordova camera API document, My code works fine and perfect in emulator, but not opening when i opens the camera in mobile,

Here is my code: config.xml

<?xml version="1.0" encoding="utf-8"?>
<widget xmlns:cdv="" xmlns:vs="" id="io.cordova.CameraTest" version="1.0.0" xmlns="">
  <description>A blank project that uses Apache Cordova to help you build an app that targets multiple mobile platforms: Android, iOS, Windows, and Windows Phone.</description>
  <author href="" email="[email protected]">Apache Cordova Team </author>
  <content src="index.html" />
  <access origin="*" />
  <preference name="SplashScreen" value="screen" />
  <preference name="windows-target-version" value="8.0" />
  <preference name="windows-phone-target-version" value="8.1" />
  <vs:plugin name="" version="0.3.2" />
  <vs:plugin name="org.apache.cordova.dialogs" version="0.2.10" />
  <feature name="" />
<feature name=""/>
<feature name=""/>
<feature name=""/>
<feature name=""/>
  <vs:platformSpecificValues />

Js code:

document.addEventListener( 'deviceready', onDeviceReady.bind( this ), false );

    function onDeviceReady() {
        // Handle the Cordova pause and resume events
        pictureSource =;
        destinationType =;
        document.addEventListener( 'pause', onPause.bind( this ), false );
        document.addEventListener( 'resume', onResume.bind( this ), false );

        // TODO: Cordova has been loaded. Perform any initialization that requires Cordova here.


    <script src="cordova.js"></script>
         var pictureSource;
                var destinationType;
                function opencam() {

          , onfail, {
                        quality: 50,
                        destinationType: destinationType.DATA_URL,
                        allowEdit: true,
                        targetWidth: 100,
                        targetHeight: 100,
                        saveToPhotoAlbum: false

                function onsucess(imageData) {

                function onfail(message) {
                    alert("Error: " + message);

Its working fine in ripple emulator, but when i install in mobile, camera is opening at all..

Note: I don't have androidmanifest.xml file in my solution

Please help me urgent!!