0

I need some help adding a button, that will start the camera and then the captured image gets uploaded to my server. the app already functions for browsing the gallery selecting a file adn uploading

I tried several answers from around the internet and none have worked. The button is aded to the layout editor I just need the code to start the camera

  • Could you please add some code? – Roman Podymov Jul 23 '19 at 14:01
  • _"I tried several answers from around the internet [...]"_ What did you try? _"[...] and none have worked."_ How did they fail? These details should be in the question. But anyway, it's actually slightly complicated. Starting the camera is easy and the answers so far point to some hints on that. Getting the image afterwards is the more difficult part. Just don't rely on `Intent data` in `onActivityResult()` as that won't work. At least not in all devices. – Markus Kauppinen Jul 23 '19 at 14:28

1 Answers1

0

If you wish to start default camera app and just get the result when user navigates back, then i suggest to use camera intent with ACTION_IMAGE_CAPTURE: https://developer.android.com/training/camera/photobasics#TaskCaptureIntent

raenardev
  • 16
  • 2