android-camera-intent

Android: Not able to call onActivityResult() method after capturing photo by camera

无人久伴 提交于 2019-12-11 07:38:11
问题 In my application when I call camera intent by: Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(cameraIntent, CAMERA_REQUEST); it not call onActivityResult() method. Problem in my application is that some time it calls this method, but some time after capturing photo it again come to photo capture screen. Before capturing photo I am saving a lot of data in onSaveInstanceState() after that I am collecting this data by onRestoreInstanceState() . Here I

How to get full size bitmap from camera?

我怕爱的太早我们不能终老 提交于 2019-12-11 04:00:33
问题 I have used intent to launch camera Intent cameraIntent = new Intent( android.provider.MediaStore.ACTION_IMAGE_CAPTURE); getParent().startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST); and onActivityResult() used Bitmap thumbnail = (Bitmap) data.getExtras().get("data"); Save_to_SD (thumbnail, filename); But get thumbnail was small size, how do I get the full bitmap? 回答1: Save output to some uri and get it from there Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION

capture image from camera and send it directly to server

≯℡__Kan透↙ 提交于 2019-12-11 00:24:51
问题 I'm trying to write a small code that allows me to send picture directly after taking it from the camera, I mean when I take picture from the camera, this picture will be sent directly to the server without to store in my phone or in the sdcard, So I made this Code but I dont know if it is correct, because Actually it shows me much message error but I don't know where is the problem or if someone can tell me where can I find similar code, // Upload Direct From Camera camButton

Camera intent onActivityResult code saves (blank) image even if photo was not accepted by user

爱⌒轻易说出口 提交于 2019-12-10 20:55:11
问题 When the user clicks the cross to not accept the photo, it ends the intent in the same way it does when they accept the photo they took. It saves a file to the device gallery. But it's blank. Shouldn't clicking the cross mean that resultCode != RESULT_OK? Is there one more check I am missing? Thanks. Here's the code. Wait, I'm saving the image before activity result...this is a flawed system, but it was on the official Android Developers website. If someone can suggest a fix I would be very

Initiate Camera Intent with the Gallery Icon

青春壹個敷衍的年華 提交于 2019-12-10 17:44:41
问题 I am working on an app that accesses the camera and returns an uri, which I pass to another activity and display the extracted bitmap in an ImageView. Everything seems to work fine. Here is the code that I use to initiate the camera intent. mCameraButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mCameraUri = getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, new ContentValues()); Intent cameraIntent = new Intent(MediaStore

What are some of the the android camera api parameters optimizations for efficiently taking pictures when camera is moved by user?

早过忘川 提交于 2019-12-10 13:14:59
问题 I am creating an android app which is sort of like stop-motion app which is intended to efficiently take pictures even during movement. I wanted to set very low shutter speed and high aperture for getting better pictures particularly when camera is in motion, but some answers on stack overflow suggest me that it is impossible to set shutter speed and aperture(Please correct me if I am wrong here). I am not using camera intent, but creating camera object with startPreview followed by

Modify Android crop intent

好久不见. 提交于 2019-12-10 11:54:34
问题 I have created a sample app for cropping images and I am calling the built-in crop intent. Here is my code: Intent intent = new Intent("com.android.camera.action.CROP"); intent.setType("image/*"); intent.setData(mImageCaptureUri); intent.putExtra("outputX", 200); intent.putExtra("outputY", 200); intent.putExtra("aspectX", 1); intent.putExtra("aspectY", 1); intent.putExtra("scale", true); intent.putExtra("return-data", true); How can I modify the crop area as per the user's input? 回答1: Yes you

how to get image name using camera intent in android?

冷暖自知 提交于 2019-12-10 10:14:13
问题 I want to show camera's current take image using like given this code.I can get image from camera and display in imageview.I want to know that image's file name. Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE ); startActivityForResult(intent, CAMERA_PIC_REQUEST); public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); switch (requestCode) { case 2: { if (resultCode == RESULT_OK) { Bitmap

android picture from camera being taken at a really small size

拈花ヽ惹草 提交于 2019-12-09 18:22:45
问题 Im trying to capture an image from the camera, compress it, then store it to the SD card. If I directly save it to the SD card using the code directly below, I get the full image. But if i try and load the image in the system, i get a super small image size such as 320 by 240 instead of a full 5 mp image. Intent intent = new Intent("android.media.action.IMAGE_CAPTURE"); intent.putExtra(MediaStore.EXTRA_OUTPUT, getImageUri()); startActivityForResult(intent, CAMERA_PIC_REQUEST); where

What's the difference between ActivityCompat and ContextCompat?

核能气质少年 提交于 2019-12-09 08:30:41
问题 I'm trying to use the Android camera, for API 23 or above, it requires asking for permission at runtime. According to the documentation, I can accomplish that using, ActivityCompat or ContextCompat. I don't understand what are the difference between the two and their trade-offs. Thank you for time. 回答1: I don't understand what are the difference between the two and their trade-offs There's no trade-off really. Not sure why they wrote so - checkSelfPermission() is a method of ContextCompat and