android-camera-intent

Getting photo from camera and gallery

走远了吗. 提交于 2020-08-19 10:38:20
问题 Hi, I am creating a simple Android app which allows user to select photo from either photo gallery or take one using camera. After getting the selected photo, I will start another activity to do something with the photo. However I have some problem displaying the photo in another activity. Here is the first activity to get photo: public class GetPhoto extends Activity implements OnClickListener { ImageButton ibPhotoLib; ImageButton ibCamera; final static int FROM_CAMERA = 0, FROM_PHOTOLIB = 1

Does Samsung Galaxy SIII have a bug in its camera?

泄露秘密 提交于 2020-03-14 05:00:24
问题 I use the following code to kick off the camera, however, 3/4's of the time, the photo does not save to memory. This only occurs on the Galaxy SIII. It works on the Nexus S and Nexus One public void photoNew() { holdingImage = getContentResolver().insert(MUtil.genImgUri(), new ContentValues()); Intent i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); Bundle extras = new Bundle(); extras.putParcelable(MediaStore.EXTRA_OUTPUT, holdingImage); extras.putBoolean("return-data", true); i.putExtras

Does Samsung Galaxy SIII have a bug in its camera?

家住魔仙堡 提交于 2020-03-14 04:56:11
问题 I use the following code to kick off the camera, however, 3/4's of the time, the photo does not save to memory. This only occurs on the Galaxy SIII. It works on the Nexus S and Nexus One public void photoNew() { holdingImage = getContentResolver().insert(MUtil.genImgUri(), new ContentValues()); Intent i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); Bundle extras = new Bundle(); extras.putParcelable(MediaStore.EXTRA_OUTPUT, holdingImage); extras.putBoolean("return-data", true); i.putExtras

Using camera to take photo and save to gallery

早过忘川 提交于 2020-02-01 05:29:11
问题 I have went through several documentation and stacks, however I'm not quite sure how do I implement this... And help or sample codes would really help me understand more. Here are the sets of codes that runs the camera and it's working perfectly fine, my next question is, how do I let it automatically saved into phone gallery? @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_home); tvCameraTiles = (TextView)

Take picture in android

眉间皱痕 提交于 2020-01-25 05:06:20
问题 Is it possible to take a picture with out opening camera ? I tried with intents but its opening camera, but i don't want to open camera.I tried following Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(takePictureIntent, 1); and after that receiving the activity.But how to do with out opening the camera? 回答1: Yes it is possible for that use SurfaceHolder.Callback Interface . And @TargetApi(9) public void surfaceCreated(SurfaceHolder holder){ Log

android show rectangle on camera

北城余情 提交于 2020-01-22 10:33:12
问题 Hi I want to show a rectangle in camera so that when the user takes snap only the region inside the rectangle can be processed. Any idea how can I do it? And the rectangle size can be resized by dragging along the corners. I am not calling the camera application. I am using the camera API. 回答1: Hi I solved the problem using this tutorial, see here If the link goes missing some day I have kept a pdf here 回答2: You can see my open source application http://code.google.com/p/android-palmprint-api

android show rectangle on camera

寵の児 提交于 2020-01-22 10:33:09
问题 Hi I want to show a rectangle in camera so that when the user takes snap only the region inside the rectangle can be processed. Any idea how can I do it? And the rectangle size can be resized by dragging along the corners. I am not calling the camera application. I am using the camera API. 回答1: Hi I solved the problem using this tutorial, see here If the link goes missing some day I have kept a pdf here 回答2: You can see my open source application http://code.google.com/p/android-palmprint-api

Android Capturing an image From Camera Returns Empty Data [duplicate]

风流意气都作罢 提交于 2020-01-16 18:07:17
问题 This question already has answers here : Android Camera : data intent returns null (11 answers) Closed 2 years ago . While Capturing image in android app intent return null each time. Please see below the code which I am using. I have tried multiple ways to get the permission as well as intent set but still I am unable to get data. Action For Camera private void takePhotoFromCamera() { if(ActivityCompat.checkSelfPermission(ObservationsView.this, Manifest.permission.CAMERA) == PackageManager

Android Capturing an image From Camera Returns Empty Data [duplicate]

走远了吗. 提交于 2020-01-16 18:06:52
问题 This question already has answers here : Android Camera : data intent returns null (11 answers) Closed 2 years ago . While Capturing image in android app intent return null each time. Please see below the code which I am using. I have tried multiple ways to get the permission as well as intent set but still I am unable to get data. Action For Camera private void takePhotoFromCamera() { if(ActivityCompat.checkSelfPermission(ObservationsView.this, Manifest.permission.CAMERA) == PackageManager

Video capturing crash on Samsung android 5 with FileProvider

给你一囗甜甜゛ 提交于 2020-01-14 05:45:08
问题 Model: Samsung SM-G900F (Android 5.0) Code to launch camera: File file = new File(getExternalFilesDir(null),"video.mp4"); Uri uri = FileProvider.getUriForFile(this, "example.com.myapplication.fileprovider", file); final Intent takePictureIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE); takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, uri); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { takePictureIntent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION| Intent.FLAG_GRANT