android-camera-intent

Getting Uri Null in capture photo from camera intent in samsung mobile

不问归期 提交于 2019-12-01 01:37:43
I am getting null in contenturi in samsung phones while capturing photo from camera but rest of others phones its working fine. @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); try { if (requestCode == IMAGE_CAPTURE) { if (resultCode == RESULT_OK){ Uri contentUri = data.getData(); if(contentUri!=null) { String[] proj = { MediaStore.Images.Media.DATA }; Cursor cursor = managedQuery(contentUri, proj, null, null, null); int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);

How to skip or avoid 'retake and review' option after capturing photo from camera using ACTION_IMAGE_CAPTURE

谁都会走 提交于 2019-11-30 23:15:03
问题 I want to display the image when I click on the photo and want to set in my ImageView without user select yes or not.... I had searched for it and I also know it very well that the camera app itself gives you the ability to review/retake the image, and once an image is accepted, the activity displays it. But, I want to do it without review/retake the activity display it..... I am trying this code fine Initialise Uri mImageCaptureUri; For Click on Button Intent intent = new Intent(MediaStore

Get Image path from camera intent

泪湿孤枕 提交于 2019-11-30 21:29:52
There is option of capture image from camera in my application.But there is problem to get image from camera. When i use ACTION_IMAGE_CAPTURE this it return null data.Please help me get image path from camera intent Error Log: 07-04 11:22:36.902: E/AndroidRuntime(8329): FATAL EXCEPTION: main 07-04 11:22:36.902: E/AndroidRuntime(8329): java.lang.RuntimeException: Unable to resume activity {com.pausefablogin/com.pausefablogin.AddPOI}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=111, result=-1, data=null} to activity {com.pausefablogin/com.pausefablogin

Where should onActivityResult be handled, dialog fragment, fragment, or activity?

匆匆过客 提交于 2019-11-30 09:52:36
问题 In my android app, I have a fragment where the user can add a picture, either from gallery or from camera. I've created an alert dialog and placed it in a DialogFragment. When the user chooses an option, I call startActivityForResult. My question is, where should ideally this result be handled? (i.e. where should i place onActivityResult?) In the DialogFragment class, the host fragment, or the host activity? Does it matter? 回答1: onActivityResult() will be invoked first on the Activity. After

android android.provider.MediaStore.ACTION_VIDEO_CAPTURE return null onActivityResult with nexus 7

限于喜欢 提交于 2019-11-30 09:19:11
I am using intent for record video. so i use following code on recordVideo button's click Videofilepath = ""; Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE); startActivityForResult(intent,REQUEST_VIDEO_CAPTURED); and in onActivityResult protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode == Activity.RESULT_OK) { switch (requestCode) { case IMAGE_PICK: this.imageFromGallery(resultCode, data); break; case IMAGE_CAPTURE: this.imageFromCamera(resultCode, data); break; case REQUEST_VIDEO_CAPTURED: this.videoFromCamera

Camera API not working on KITKAT

邮差的信 提交于 2019-11-30 07:29:35
I have a really strange problem. The following code I have is used to take a picture on button click. It works properly on Jelly Bean phones, but not on Kitkat: MainActivity.java : package com.example.takepic; import android.app.Activity; import android.content.pm.PackageManager; import android.hardware.Camera; import android.hardware.Camera.CameraInfo; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.Toast; public class MainActivity extends Activity { private final static String DEBUG_TAG = "MakePhotoActivity";

How to write exif data to image in Android?

北战南征 提交于 2019-11-30 06:57:08
I'm trying to write a User_Comment and TAG_GPS to a captured image in an Android application using the exif interface, but for some reason the tags don't seem to be appended to the image when I view the image's details in the gallery. It seems that maybe the tags are not being written to the captured image as the file path may be wrong. I think it could be because I've written the tags to an incorrect image path. Does anyone know if their is a problem with the way I'm writing the tags to the image? This is the code that saves the exif data following @Charlie's changes below: private File

Camera on Android Example

孤街浪徒 提交于 2019-11-29 20:39:07
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 main approaches: Use the android.provider.MediaStore.ACTION_IMAGE_CAPTURE event. See this question Use the

Where should onActivityResult be handled, dialog fragment, fragment, or activity?

旧城冷巷雨未停 提交于 2019-11-29 16:20:33
In my android app, I have a fragment where the user can add a picture, either from gallery or from camera. I've created an alert dialog and placed it in a DialogFragment. When the user chooses an option, I call startActivityForResult. My question is, where should ideally this result be handled? (i.e. where should i place onActivityResult?) In the DialogFragment class, the host fragment, or the host activity? Does it matter? onActivityResult() will be invoked first on the Activity. After that it will be reached out to the Fragments, if you call super.onActivityResult() in your Activity. This is

Custom Video Recording Screen

耗尽温柔 提交于 2019-11-29 15:49:54
问题 I am trying to implement an application which when starts starts video recording automatically with my custom video recording screen with my own button to stop the recording and with other buttons. What I have done is designed the layout with buttons till now but how to add video recording screen in the background..Please help.! 回答1: This is how I achieved it: public class MainActivity extends Activity implements SurfaceHolder.Callback { private MediaRecorder recorder; private SurfaceHolder