Selecting Image for image gallery works on emulator but on the phone

I am trying to select image from the image gallery of android phone and it runs as excepted in the emulator but when I install it in my galaxy s4, it doesn’t work. The code snippet is as below


<button class="button-positive button-block button" ng-click="PhotoLibrary()">Select Picture <i class="ion-android-image"></i></button>









$scope.PhotoLibrary = function (){
            $scope.image = document.getElementById('smallimage');
            if ({
        photoSuccess, photoError,
                     {     quality: 50,

                } else {
                    alert('camera not found');

         function photoSuccess(imageURI) {
            if (imageURI.substring(0,21)=="content://") {
              var photo_split=imageURI.split("%3A");
            $scope.imageURI = imageURI
            $scope.image.src = $scope.imageURI;

function photoError(message) {
alert('Failed because: ’ + message);

I have used similar code to @mrvamsidhar, for selecting the image from the image. It works fine in the emulator but it doesnt work in the real devices though and whenever I click on the button to select the image, it alerts me ‘camera not found’ . Does anyone know why it happens?? Any help on this matter will be much appreciated thanks.

Have you installed camera plugin ?

Thanks for the reply and yes, I have installed the cordova plugin for the camera but it doesn’t work.

It looks like plugin issue to me.

@mrvamsidhar, did u have any issues on your app? I mean have u tried installing on android phone? I was curious as I have use the code similar to yours.