Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 3
Message 1 of 2 camera not working. What am I missing here?

Hi guys,


For a school project I have to make an app in but I'm really struggling to say the least. One of the things I need to implement is the camera. It doesnt have to save the picture or anything, just activate the camera. I have followed the following tutorial which is in Dutch and rather old but I have looked at different forums and found stuff like this. I have tried quite a lot of solutions now but nothing seems to work. I also tried to read the documentation on the plugin as well but it is hard to understand. I don't have basic knowledge of javascript and it is not part of my schools curriculum. Obviously I must be doing something wrong, but I don't know what. At the moment I just got a screen with a button and when I press it, nothing seems to happen. Please help me out. You'll find the code below:

Map structure:

  • index.html
  • config.xml
  • css
    • index.css
  • js
    • index.js



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

    function onDeviceReady()


    function cameraSuccess(imageData)

        $('#maak-foto').after('<img src="' + "data&colon;image/jpeg;base64," + imageData + '">');

    function cameraError(message)

        alert('Er ging iets fout! ' + message);

  cameraSuccess, cameraError, {
            quality: 50, // Foto kwaliteit
            destinationType: Camera.DestinationType.DATA_URL // Base64 gecodeerde afbeelding als resultaat



        <meta charset="utf-8" />
        <meta name="format-detection" content="telephone=no" />
        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
        <link rel="stylesheet" type="text/css" href="css/index.css" />
        <title>Foto maken</title>
        <div class="app">
            <button id="maak-foto">Maken</button>
        <script type="text/javascript" src="phonegap.js"></script>
        <script type="text/javascript" src="js/jquery.js"></script>
        <script type="text/javascript" src="js/index.js"></script>


<widget xmlns     = "<a href="" target="_blank"></a>"
        xmlns:gap = "<a href="" target="_blank"></a>"
        id        = "com.phonegap.hello-world"
        version   = "1.0.0">

    <name>Camera App</name>

        Camera example app.

    <author href="<a href="" target="_blank"></a>" email="">
        PhoneGap Team
    <feature name="<a href=""/" target="_blank">"/</a>>

    <plugin name="cordova-plugin-camera" source="npm"/>
1 Reply
Copilot Lvl 3
Message 2 of 2

Re: camera not working. What am I missing here?

It gives the following error in chrome: Failed to load resource: the server responded with a status of 404 (Not Found). And its talking about the phonegap.js here. I see that in my first try I forgot to put in the jquery. After I put it in, it won't install on my phone. I just get a message with: App not installed.