This is a migrated thread and some comments may be shown as answers.

camera is not working

1 Answer 61 Views
Sample Applications
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mike
Top achievements
Rank 1
Mike asked on 28 Aug 2015, 12:52 AM

i put the code in just as the TUT tell me to but it is not working

source: telerik platform, course: 5/7, add photos to your library using your camera​

can anyone help?

(function () {
    document.addEventListener("deviceready", function () {

        window.listView = kendo.observable({
            addImage: function () {
                var success = function (data) {
                    $("#images")
                        .data("kendoMobileListView")
                        .prepend(["data:image/jpeg;base64," + data]);
                };
                var error = function () {
                    navigator.notification.alert("Unfortunately we could not add the image");
                };
                var config = {
                    destinationType: Camera.DestinationType.DATA_URL,
                    targetHeight: 400,
                    targetWidth: 400
                };
                navigator.camera.getPicture(success, error, config);
            }
        });

        var app = new kendo.mobile.Application(document.body, {
            skin: "flat"
        });
        $("#images").kendoMobileListView({
            dataSource: ["images/01.jpg", "images/02.jpg", 
                         "images/03.jpg", "images/04.jpg", 
                         "images/05.jpg", "images/06.jpg", 
                         "images/07.jpg"],
            template: "<img src='#: data #'>"
        });
        navigator.splashscreen.hide();
    });
}());

 

 

1 Answer, 1 is accepted

Sort by
0
Dimitar Kerezov
Telerik team
answered on 01 Sep 2015, 11:59 AM
Hi Mike,

The javascript code you've provided seems all right to me. My guess would be there is something wrong with the markup of your project. Could you elaborate a bit further on the issues are you experiencing? For example, what is the exact behavior of the application, blank screen, javascript error or something else?

Further, feel free to open a support ticket and attach the project in it so we can examine it further.

Let me know if this helps.

Regards,
Dimitar Kerezov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Sample Applications
Asked by
Mike
Top achievements
Rank 1
Answers by
Dimitar Kerezov
Telerik team
Share this question
or