0

I am trying to develop a cross platform app for iOS, Android and Windows Phone. I am done with most of my coding and am currently testing the apps. I am using the DevExtreme tools (from DevExpress) and from my knowledge they use PhoneGap for packaging native apps. I sideloaded the app on my Android and Windows phone.

My requirement is to use the camera to take a picture and send it to a remote server WITHOUT saving the image to the device.

I was using the "Camera.destination" as "DATA_URL" and it seems to be working fine with andoird and iOS. The image is sent to the server and the image does not show up in the "Saved Photos" (Gallery/Photo Album). From my understanding I am assuming the image was in memory on these devices and the Base64 string is discarded once the app is closed.

This does not happen with Windows phone. I tried it and the images seem to be saved on the disc always. I still see that the app is successfully sending the image to the remote server. My requirement is that the image never be saved on disc.

 navigator.camera.getPicture(onSuccess, onFail, {
            quality: 50,
            destinationType: Camera.DestinationType.DATA_URL
        });

Is using DATA_URL the right way to do it ? if so is this not supported by a windows phone ?

Ron
  • 886
  • 13
  • 39
  • 1
    i had same problem and figured out this option will not work only in Windows phone 8. Hence i designed custom camera which did the job for me. you can get an example from msdn on this. – NiRUS Apr 30 '14 at 07:09

1 Answers1

0

If you used

destinationType: Camera.DestinationType.FILE_URI 

it would save it to a temporary folder and delete it when they leave the application. And it's also their recommended use case at: http://docs.phonegap.com/en/1.2.0/phonegap_camera_camera.md.html

Alternatively, you could add a check to see if Camera.DestinationType.DATA_URL is set and valid before using it. It may be that the other phone types have a default value for it when not set but the Windows phone program does not.

Barring that, you could always hard-code either a 0 or 1 (depending on how it should be received) instead of the variable (Camera.DestinationType.Data_URL).

Joshua Walcher
  • 506
  • 4
  • 14
  • I tried hardcoding (0 - DATA_URL) but it still saves it to the disk. – Ron Apr 29 '14 at 21:03
  • I was thinking it would look like: navigator.camera.getPicture(onSuccess, onFail, { quality: 50, destinationType: 0 }); If that's what you did and it still failed, it sounds like a bug in PhoneGap, since they say near the top of the documentation that the settings work on Windows phones. I will follow up and see if I can find the exact issue. – Joshua Walcher Apr 29 '14 at 21:59
  • [Are you using PhoneGap 2.3.0 or greater? That's the first version of PhoneGap to officially support WP8.](http://stackoverflow.com/questions/14300994/navigator-camera-getpicture-not-work-in-windowsphone8-emulator) It could also be [this](http://stackoverflow.com/questions/20429025/windows-8-cordova-navigator-camera-getpicture) – Joshua Walcher Apr 30 '14 at 01:25
  • By default all devextreme applications use Cordova 2.9.0 if I understand it correctly – Ron Apr 30 '14 at 02:45
  • Do you have any idea about any development on this ? I have been trying but I could not find a way around this except for maybe use a custom camera – Ron Jun 27 '14 at 20:58