Take Picture with Camera - Android Studio - Java

  Рет қаралды 57,244

Atif Pervaiz

Atif Pervaiz

5 жыл бұрын

In this Video we will capture image with Camera using the Camera Intent. Camera will be opened after clicking the button. If image is captured it will be set to an ImageView.
We will require following permission:
1) CAMERA
2) WRITE_EXTERNAL STORAGE
So we will also handle Runtime Permission for OS Marshmallow and above.
Buy Me a Coffee: paypal.me/atifsayings
Feel free to comment in case of any problem
Chanel:
/ mohammadatif1
Websites:
technifysoft.com/
devofandroid.blogspot.com
Apps/Games on PlayStore:
play.google.com/store/apps/de...
If u like this video, Like, Comment, Subscribe to support us...

Пікірлер: 100
@ederperez7589
@ederperez7589 3 жыл бұрын
Excellent my friend!!
@javierdiaz1696
@javierdiaz1696 4 жыл бұрын
Thank you very much for the video you were the only one who could make a tutorial to take a photo on android 9 thank you very much you are the best
@mylalaprofile
@mylalaprofile Жыл бұрын
Clear and easy to follow, just what I was looking for. The only video about this topic that shows how to do it, step by step, and when following the instructions, it works 😆. Thanks. 😄
@AtifSayings
@AtifSayings Жыл бұрын
Glad it helped!
@marcfinger4549
@marcfinger4549 4 жыл бұрын
I followed everything and it worked. I'm using API 26. Thanks!
@arastoamel6509
@arastoamel6509 5 жыл бұрын
thanks my friend. that was perfect.
@toribio0hack
@toribio0hack 4 жыл бұрын
Mastodonte , Fiera, Lomo plateado , espalda de oro , muy bien echo el video :D
@linoalejandromunozbuesaqui2706
@linoalejandromunozbuesaqui2706 4 жыл бұрын
I really appreciate your help! That was awesome, so clear and so efficient! Greetings from Colombia Thank you so much!
@AtifSayings
@AtifSayings 4 жыл бұрын
you're welcome 😊
@student9297
@student9297 3 жыл бұрын
@@AtifSayings ?
@yigitkemalagac
@yigitkemalagac 4 жыл бұрын
Nice and clean code, thank you :)
@devagaikwad3644
@devagaikwad3644 3 жыл бұрын
Thanks dude u made my day. thanks a lot
@FernandoGarcia-tf1gn
@FernandoGarcia-tf1gn Жыл бұрын
Really nice brother, thank you, even if some terms are deprecated now
@yrrag
@yrrag 3 жыл бұрын
Nice, thank you so much
@miriam_sirota
@miriam_sirota Жыл бұрын
thank you so much! that was very good and helped me alot!
@AtifSayings
@AtifSayings Жыл бұрын
You're welcome
@hamzakhouya9833
@hamzakhouya9833 4 жыл бұрын
Thank you so much! I have a question what I need to do to make image processing on this image before show it in imageView Thank you
@h4cker54n
@h4cker54n 4 жыл бұрын
Thanks, really thanks my friend.!!!!
@AtifSayings
@AtifSayings 4 жыл бұрын
You're welcome
@mohamedagbaria3454
@mohamedagbaria3454 3 жыл бұрын
Great! thank you sir
@AtifSayings
@AtifSayings 3 жыл бұрын
You're welcome
@priyap7264
@priyap7264 3 жыл бұрын
I am receiving uri of image in the onActivityResult and the captured image is stored in the gallery but not set in the imageview
@ilkerylmaz
@ilkerylmaz Жыл бұрын
thank you
@alexxx1629
@alexxx1629 4 жыл бұрын
very helping... thank you very much btw do you have a tutorial on how to insert the taken picture into database server?
@subhamsahoo3078
@subhamsahoo3078 4 жыл бұрын
Thanks bro
@olukayodepaul7070
@olukayodepaul7070 5 жыл бұрын
Weldone. working fine. how to convert the image to bitmap and upload to server
@umtrouxaqualquer9453
@umtrouxaqualquer9453 3 жыл бұрын
cara o fato de você pegar a imagem da camera com um Uri salvou minha pela valeu mesmo
@AtifSayings
@AtifSayings 3 жыл бұрын
Kindly, write in English
@rpsborja
@rpsborja 3 жыл бұрын
@@AtifSayings you save him
@earllouiebagay5522
@earllouiebagay5522 4 жыл бұрын
Hi Sir, after taking the picture it redirect me to the MainActivity. Any idea how to redirect to the activity where the picture will be taken? Thanks in advance.
@MrSpock-sm3dd
@MrSpock-sm3dd 3 жыл бұрын
I don't know why people never provide the code in the description. Do I really need to transcribe all of it just to discover that it won't work because something is missing. Why can't you just provide the code so I can figure out if it works and come back here to say thanks and upvote the video
@godwingeorgethekkanath
@godwingeorgethekkanath 4 жыл бұрын
While clicking the ok buttom from camera. The app says unfortunately app is stopped. How to solve this?
@yosipipi
@yosipipi 4 жыл бұрын
thanks a lot!!
@AtifSayings
@AtifSayings 4 жыл бұрын
You're welcome
@abdelrahmanabied5982
@abdelrahmanabied5982 4 жыл бұрын
thanks a lot for amazing tutorial how i can delete image when take new image or delete it in general
@Domuh
@Domuh 2 жыл бұрын
I got stuck at the startActivityForResult(cameraIntent, IMAGE_CAPTURE_CODE); because it says that startActivityForResult is deprecated. Can you help on updating this code?
@abarnachandresan5914
@abarnachandresan5914 5 жыл бұрын
Please upload a video and code for take picture with openCV
@yovanerent6561
@yovanerent6561 4 жыл бұрын
thankyou for nice tutorial, but how restore image to mysql database? thanks
@hasantalukder2981
@hasantalukder2981 4 жыл бұрын
Thanks bro app is working....
@AtifSayings
@AtifSayings 4 жыл бұрын
You're welcome
@sheikhfaizan9414
@sheikhfaizan9414 4 жыл бұрын
if i want to add crop option in camera then kia karna pare ga?
@coldworld3102
@coldworld3102 4 жыл бұрын
how is it now possilble to zoom into the image?
@damiandeligdisch822
@damiandeligdisch822 4 жыл бұрын
Hello, can you use Sourcelabs to take a photo, with this code?
@blacklotus9281
@blacklotus9281 3 жыл бұрын
I have watched a number tutorials but all of you guys use same layout, bring some innovation. please
@garetht.542
@garetht.542 3 жыл бұрын
Is it compulsory to put the ContentValues? Or can I just use the cameraIntent code to take a picture?
@AtifSayings
@AtifSayings 3 жыл бұрын
To take high resolution image you need to do that.
@jawadkhan2566
@jawadkhan2566 5 жыл бұрын
captured Image is not showing in imageView :(
@godwingeorgethekkanath
@godwingeorgethekkanath 4 жыл бұрын
The same occurs for me. While clicking the ok buttom from camera. The app says unfortunately app is stopped. Have you solved the issue? If yes how you got it?
@jaysonaquino8252
@jaysonaquino8252 5 жыл бұрын
why the image is rotating when its displayed in imageview?
@1000email
@1000email 4 жыл бұрын
something is not right with your Layout orientation, i think.
@user-iy4rb2uq9e
@user-iy4rb2uq9e 4 жыл бұрын
just use img.setRotation();
@abhishekbandekar7884
@abhishekbandekar7884 3 жыл бұрын
@@user-iy4rb2uq9e thanks
@siebprintch
@siebprintch 3 жыл бұрын
Thank you! works fine. Is it possible to take the captured picture directly, without need to "confirmation" on the camera display.? I have see this code: cameraIntent.putExtra("android.intent.extra.quickCapture",true) but is not work. Have you a solution? Thank you for the answer. Best regards Mario
@AtifSayings
@AtifSayings 3 жыл бұрын
No idea
@electronicsandcommunicatio1817
@electronicsandcommunicatio1817 4 жыл бұрын
How can i save photo in my gallery
@vidyesh
@vidyesh 4 жыл бұрын
It should be IMAGE_CAPTURE_CODE in onActivityResult and not RESULT_OK ```@Override protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { // method called when image was captured from camera super.onActivityResult(requestCode, resultCode, data); if (requestCode == IMAGE_CAPTURE_CODE) { // set image captured to ImageView mImageView.setImageURI(image_uri); } }```
@ssousagabriel
@ssousagabriel 4 жыл бұрын
A imagem sai rodada, como conserta isso?
@sywarmhirthi5684
@sywarmhirthi5684 3 жыл бұрын
How to save this captured picture into mysql databse?
@AtifSayings
@AtifSayings 3 жыл бұрын
I've made videos on SQLite, you may check them
@chinmayk3409
@chinmayk3409 3 жыл бұрын
Image not settig in image view ?
@AtifSayings
@AtifSayings 3 жыл бұрын
in onActivityResults method check by placing toast or log either you're receiving uri of image or not
@sajadbaharum4962
@sajadbaharum4962 5 жыл бұрын
How to save the image captured in device's gallery?
@AtifSayings
@AtifSayings 5 жыл бұрын
I had not made separate video for that but you can watch from this video: kzbin.info/www/bejne/ooeUnJutf6utmaM
@sajadbaharum4962
@sajadbaharum4962 5 жыл бұрын
@@AtifSayings Im not sure which one is the save image part. Can you tell me which minutes the save part? Im confused where should i include the 'save image' code
@AtifSayings
@AtifSayings 5 жыл бұрын
@@sajadbaharum4962 start from 7:10 in that video
@sajadbaharum4962
@sajadbaharum4962 5 жыл бұрын
@@AtifSayings alright, thanks so much!
@AtifSayings
@AtifSayings 5 жыл бұрын
@@sajadbaharum4962 you're welcome
@beautyisyours6555
@beautyisyours6555 5 жыл бұрын
i got error like cannot resolve checkselfpermission(java.string.lang)
@marcvilarrubias4177
@marcvilarrubias4177 5 жыл бұрын
You need to extend Appcompat to your activity or use CompatActivity(). If not like in fragments try this: ContextCompat.checkSelfPermission(getActivity(),Manifest.permission.CAMERA) == PackageManager.PERMISSION_DENIED ........
@kkhemara
@kkhemara 4 жыл бұрын
findViewById not working for me
@sravyavulisetty8565
@sravyavulisetty8565 3 жыл бұрын
App getting closed after clicking on the capture image. Can you please help it out.Thanks in advance
@AtifSayings
@AtifSayings 2 жыл бұрын
Check logcat for crash reason
@VasuGarg
@VasuGarg 5 жыл бұрын
sir i want to open front camera only..pls tell me how to do it.
@marulihasurungan5150
@marulihasurungan5150 3 жыл бұрын
my camera phone is not show it :(
@jnanavijanu7909
@jnanavijanu7909 Жыл бұрын
Hello sir,May i get source code of this?
@AtifSayings
@AtifSayings Жыл бұрын
devofandroid.blogspot.com/2018/09/take-picture-with-camera-android-studio.html
@jnanavijanu7909
@jnanavijanu7909 Жыл бұрын
Thank you
@halitmubayyid6310
@halitmubayyid6310 3 жыл бұрын
يسلمون
@pokonyang3317
@pokonyang3317 5 жыл бұрын
sir,the image didnt want to show,can you help me?
@AtifSayings
@AtifSayings 5 жыл бұрын
what happens when you select image (from camera/gallery)
@pokonyang3317
@pokonyang3317 5 жыл бұрын
@@AtifSayings the image is appear in the gallery but,it didnt appear in the application after i take the picture
@naeemramputh4839
@naeemramputh4839 5 жыл бұрын
I'm having the same problem help please
@naeemramputh4839
@naeemramputh4839 5 жыл бұрын
when tapping on ok on my device the src is disappearing, so i guess it is receiving the image but it is invisible!!
@AtifSayings
@AtifSayings 5 жыл бұрын
@@pokonyang3317 and @Naeem then you're doing mistake in onActivityResult method, recheck carefuly
@nishthapandya8809
@nishthapandya8809 3 жыл бұрын
There is an error. Please can you help solve it ? "Attempt to invoke virtual method 'void android.widget.ImageView.setImageURI(android.net.Uri)' on a null object reference" . Please need help urgently.
@AtifSayings
@AtifSayings 3 жыл бұрын
I think you have not initialized image view or initialized with a wrong id. Make sure your image view is initialized with a correct id that is in xml of that activity
@nishthapandya8809
@nishthapandya8809 3 жыл бұрын
@@AtifSayings Thank you so much ! What to do if I have to show the image on the next activity. Like what if the ImageView is on the next activity. How can we do that ?
@AtifSayings
@AtifSayings 3 жыл бұрын
@@nishthapandya8809 when you pick an image you got URI of that image, you can pass data using the intent to start activity
@nishthapandya8809
@nishthapandya8809 3 жыл бұрын
@@AtifSayings Thank you so much
@AtifSayings
@AtifSayings 3 жыл бұрын
@@nishthapandya8809 You're welcome
@yeongytv8168
@yeongytv8168 5 жыл бұрын
can i have the source code file? PLEASE PLEASE PLEASE!!!!!! HELP ME !!!!! I NEED THE FILE
@AtifSayings
@AtifSayings 5 жыл бұрын
devofandroid.blogspot.com/
@Nyx_z_
@Nyx_z_ 5 жыл бұрын
AAAAAAAAAAAAAHHHHHH!!!!!!!!!
@batucanedison
@batucanedison 3 жыл бұрын
anyone getting permission denied??
@nurulamiramohdisnin5377
@nurulamiramohdisnin5377 4 жыл бұрын
why my image cannot set at ImageView after take a picture?
@AtifSayings
@AtifSayings 4 жыл бұрын
Chec onActivityResult method
Pick Color from Image - Android Studio - Java
9:44
Atif Pervaiz
Рет қаралды 11 М.
когда повзрослела // EVA mash
00:40
EVA mash
Рет қаралды 3,5 МЛН
Haha😂 Power💪 #trending #funny #viral #shorts
00:18
Reaction Station TV
Рет қаралды 15 МЛН
Pick an Image from the Gallery - Android Studio - Java
11:06
Atif Pervaiz
Рет қаралды 60 М.
Capture picture from camera - Android Studio Tutorial
23:54
The Code City
Рет қаралды 57 М.
KMP vs. Flutter - Who Will Win The Cross-Platform Battle?
16:19
Philipp Lackner
Рет қаралды 32 М.
1 Setting up permissions
26:38
course gallery
Рет қаралды 9 М.
Upload Image to Server using Retrofit in Android Studio
21:21
Waleed Talha
Рет қаралды 27 М.
Android Studio Tutorial - Camera 2 API FULL
33:38
EDMT Dev
Рет қаралды 152 М.
когда повзрослела // EVA mash
00:40
EVA mash
Рет қаралды 3,5 МЛН