2

I tried to make a android app using HTML + phonegap 2.6.0 which is support:

<input type="file" />

By default, if the HTML is open via android browser itself, it will show "camera" , "gallery" , "dropbox" etc when clicking @ browse button. But if I run the HTML on app webview, file chooser is coming up which is we can choose from gallery, dropbox, music track etc except from camera.

I tried to use:<input type="file" accept="image/*" /> perhaps when I run the app it will showing camera icon to choose. Unfortunately no.

My objective is when i press on browse button, the camera icon is showing up together with gallery etc.. It is possible to do this with phonegap? :(

David
  • 4,027
  • 10
  • 50
  • 102
Safrul
  • 77
  • 1
  • 8
  • Click to find the answer: http://stackoverflow.com/questions/13861310/how-to-upload-file-with-phonegap-and-jquerymobile/42412661#42412661 – Rakesh Samal Feb 23 '17 at 10:14

1 Answers1

2

For same need, i've madea custom menu with 2 button ! Take from camera / take from picture. After just use phone gap function camera.getPicture that opens the device's default camera application so that the user can take a picture (if Camera.sourceType = Camera.PictureSourceType.CAMERA, which is the default). Once the photo is taken, the camera application closes and your application is restored.

If Camera.sourceType = Camera.PictureSourceType.PHOTOLIBRARY or Camera.PictureSourceType.SAVEDPHOTOALBUM, then a photo chooser dialog is shown, from which a photo from the album can be selected.

http://docs.phonegap.com/en/2.6.0/cordova_camera_camera.md.html#Camera

TheLazyFox
  • 1,065
  • 3
  • 11
  • 27