Camera restarts application


#1

I just impleme ted ng-cordova in my application.
Now ive got a strange behaviour.
When i take a photo and i clich ok, my application restarts( like a location.restart() )
What i have read as far is android related coze memory is low and the app goes into stop stage.

The strange thing is i have the problem on ios 7.1.1 (iphone 5) and with cordova 3.5/3.2.
Sometimes it works and most of time not. (Same behaviour without ng-cordova)

I had never the problem using kendo ui mobile. And if im right kendo ui renders whole application and ionic just the part that is needed.

So my questions:
Does anyone of you have or had the same problem?
Hoe much memory does ionic normaly take?


#2

As far as memory usage, ionic, or angular/javascript, will only take up as about memory as you let it.

What does you code look like? Can you post some code? Maybe theres a error in there.

As far as kendo ui mobile goes, it’s in the same boat as ionic, it relies on cordova/phonegap


#3

I used the same example as you prove on the ng-cordova site.

on html i got this line for showing the taken picture:

<img id="personImage" src="img/unknown-person.png" ng-click="GetPicture()"/>

in my Controller i use this as Variant one (without ng-cordova / used in my kendo ui app and never had the problem):

$scope.GetPicture = function () {
   navigator.camera.getPicture($scope.onCaptureSuccess, $scope.onCaptureError, {
       quality: 75,
       destinationType: Camera.DestinationType.DATA_URL,
       allowEdit: true,
       targetWidth: 165,
       targetHeight: 165
   });
};

$scope.onCaptureSuccess = function (imageData) {
     var smallImage = document.getElementById('personImage');
     smallImage.style.display = 'block';
     smallImage.src = "data:image/jpeg;base64," + imageData[0];
 };
$scope.onCaptureError = function (e) {
    alert(e);
 };

Variant two using ngCodova:

$scope.GetPicture = function() {
    var options = { 
        quality : 75, 
        destinationType : Camera.DestinationType.DATA_URL, 
        sourceType : Camera.PictureSourceType.CAMERA, 
        allowEdit : true,
        targetWidth: 165,
        targetHeight: 165,
        saveToPhotoAlbum: false
    };

    $cordovaCamera.getPicture(options).then(function(imageData) {
       var smallImage = document.getElementById('personImage');
       smallImage.style.display = 'block';
       smallImage.src = "data:image/jpeg;base64," + imageData[0];
    }, function(err) {
      alert(err);
    });
  }

#4

Take a look at this example app, it should help you out.


#5

found the problem with the camera

im using AppBuilder to build my App and they have a bug with there LiveSync
http://docs.telerik.com/platform/appbuilder/troubleshooting/known-issues#appbuilder-livesync


#6

Ahh alright, thats an unfortunate bug, shame to see that theres no work around for it too