android-camera-intent

Camera on Android Example

蹲街弑〆低调 提交于 2019-12-18 10:16:37
问题 I want to write an activity that: Shows the camera preview (viewfinder), and has a "capture" button. When the "capture" button is pressed, takes a picture and returns it to the calling activity (setResult() & finish()). Are there any complete examples out there that works on every device ? A link to a simple open source application that takes pictures would be the ideal answer. My research so far: This is a common scenario, and there are many questions and tutorials on this. There are two

android 4.4 video from camera gives security Exception

无人久伴 提交于 2019-12-18 08:57:28
问题 I am using following code for video recording using camera code on record button click:- intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE); fileUri = getOutputMediaFile(MEDIA_TYPE_VIDEO); // create a file to save the video in specific folder (this works for video only) intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1); // set the video image quality to high // start the Video Capture Intent startActivityForResult(intent,

android pass media data to another activity [duplicate]

99封情书 提交于 2019-12-18 07:14:10
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Passing image from one activity another activity my app uses following logic: a button click in Activity A starts the phone camera, after a picture/video is taken (the user pressed "save" in the camera window) Activity B starts. That Activity B contains a preview of taken picture/video and the possibility to upload the media data via a http request. I'm not sure how to pass the taken Image/Video to Activity B..

Capture photo rotate 90 degree in samsung mobile

戏子无情 提交于 2019-12-18 04:50:32
问题 Photo is rotating 90 degree while capturing from camera in samsung mobile rest of other mobiles(HTC) its working fine. Please help me for this. Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(cameraIntent, IMAGE_CAPTURE); @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); try { if (requestCode == IMAGE_CAPTURE) { if (resultCode == RESULT_OK){

android camera portrait orientation

只谈情不闲聊 提交于 2019-12-18 01:05:48
问题 I am using camera in my app. I am just using intent to start camera Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri); startActivityForResult(cameraIntent, 101); The captured image automatically comes in landscape view . How do i make camera to capture images in portrait view 回答1: If device has v2.2 or above you can rotate camera orientation to portrait using camera.setDisplayOrientation(90) . In

Null pointer Exception on file- URI?

二次信任 提交于 2019-12-17 20:37:09
问题 In my app a capture button is there to capture an image using device camera,so I have used a method captureImage() on the click event of that button.When I click the button a null pointer exception is thrown.I could not understand how this happens Can anyone help? Thanks in advance! capture button on on Create () method photoButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { /* Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION

Android - Camera intent low bitmap quality [duplicate]

﹥>﹥吖頭↗ 提交于 2019-12-17 16:45:36
问题 This question already has answers here : Low picture/image quality when capture from camera (2 answers) Closed 4 months ago . When taking a picture using the android camera Intent, I get a low-quality bitmap image. I was wondering if it is possible to make this image decent quality. I googled some information about it and I think that I have to use 'EXTRA_OUTPUT' (http://developer.android.com/reference/android/provider/MediaStore.html#ACTION_IMAGE_CAPTURE) I am struggling because I don't know

android camera: onActivityResult() intent is null if it had extras

大城市里の小女人 提交于 2019-12-17 10:43:21
问题 After searching a lot in all the related issues at Stack Overflow and finding nothing, please try to help me. I created an intent for capture a picture. Then I saw different behavior at onActivityResult() : if I don't put any extra in the Intent (for small pics) the Intent in onActivityResult is ok, but when I put extras in the intent for writing the pic to a file, the intent in onActivityResult is null ! The Intent creation: Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE

Image loses it's original result when passing it to another activity

我怕爱的太早我们不能终老 提交于 2019-12-17 10:07:16
问题 I am working on a camera feature in my application. I am capturing an image and passing it to another activity. The problem that I'm facing is when I display the image in another activity it loses its original result (gets pixilated) for some reason. This is how I'm doing it: private void takePhotoFromCamera() { if(ActivityCompat.checkSelfPermission(EnterDataView.this, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED){ Intent cameraIntent = new Intent(android.provider

android: Take camera picture without “save” / “delete” confirmation

坚强是说给别人听的谎言 提交于 2019-12-17 07:26:26
问题 I want to display an image taken from the camera in an ImageView using Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); This works fine so far but after the user takes the photo using the chosen camera app a dialog (probably from the app) appears asking whether to save or delete the taken picture (at least on Android 2.3 and 4.2 using the default camera app). I would like to skip this extra dialog and directly display the image in the ImageView (when