Add spinner to phonegap camera widget

Hi, the phonegap camera widget allows you to create a picture on your mobile device. Then when the picture is taken and confirmed, it does take a couple of seconds to go back to the mendix page where you activated the camera.  This happens when you have the autosave feature enabled. This means it takes some time to save the picture, and extra time is needed if you have a custom microflow on save . Anyways I think it would be nice to have a visual feedback that the system is busy.  Do you have suggestions on how to implement this feature?
3 answers

Debug in the Chrome console to find the place where you'd like to start + stop the progress bar. Then use the following snippet to change the widget src:

var pid = mx.ui.showProgress(); // show progress dialog
mx.ui.hideProgress(pid); // hide it again

There is actually a pullrequest pending on GitHub for this widget which provides this, and more. I also submitted a pull request, to make it open the camera immediately upon opening the page. Hopefully these get some attention in the near future.


The spinners don't show any real progress. Would recommend to have a look at the onprogress option.

var ft = new FileTransfer();
ft.onprogress = function(progressEvent) {
    if (progressEvent.lengthComputable) {
        loadingStatus.setPercentage(progressEvent.loaded /;
    } else {
ft.upload(fileURL, uri, win, fail, options);