android-camera-intent

How to move image captured with the phone camera from one activity to an image view in another activity?

主宰稳场 提交于 2019-11-29 15:16:14
The first activity has a button which when clicked, opens the inbuilt camera. Now when the picture is taken, a new activity opens with the image captured in an imageView and a share button in the next activity. I have set up the activity to open after the image is taken, however I am unable to transfer image captured across activities. Please i need help or a nudge in the right direction. The first activity which takes the picture is Takepicture.java : import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Bitmap; import

How to lock the orientation to Portrait when using intent ACTION_IMAGE_CAPTURE?

為{幸葍}努か 提交于 2019-11-29 15:15:55
I know I can set the orientation of the activity in the manifest, but when this activity is calling the MediaStore.ACTION_IMAGE_CAPTURE to open the camera and take a photo, the user can still take photos in landscape mode. Can I lock the orientation of the camera app itself to portrait? Here is a sample code: Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo)); startActivityForResult(intent, TAKE_PICTURE); I would like to prevent the user from taking any landscape photos. Any help would be greatly appreciated. EDIT : Found

Camera Intent returns null onActivityResult

一个人想着一个人 提交于 2019-11-29 12:49:21
I am trying to take a photo and to save it to a custom location- public void SavePhoto(View view){ Intent imageIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()); File imagesFolder = new File(Environment.getExternalStorageDirectory(), "WorkingWithPhotosApp"); imagesFolder.mkdirs(); File image = new File(imagesFolder, "QR_" + timeStamp + ".png"); Uri uriSavedImage = Uri.fromFile(image); imageIntent.putExtra(MediaStore.EXTRA_OUTPUT, uriSavedImage); startActivityForResult(imageIntent, REQUEST_IMAGE

When using the Camera app in Android, how can I return the whole image instead of just the thumbnail?

删除回忆录丶 提交于 2019-11-29 12:49:01
I am making an app that sends a picture taken from the Camera app however the image it returns seems to be only a thumbnail how can I get it to turn the whole image? The following code gets an image, but it's too small. public class OnTheJobActivity extends Activity{ private static final int CAMERA_PIC_REQUEST = 1337; private Button takePictureButton; private Button sendPictureButton; private Bitmap thumbnail; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setRequestedOrientation(

Camera API not working on KITKAT

痴心易碎 提交于 2019-11-29 10:35:27
问题 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;

How to get path of picture in onActivityresult (Intent data is null)

↘锁芯ラ 提交于 2019-11-29 10:33:18
I have to launch the camera, and when the users has done the picture, I have to take it and show it in a view. Looking at http://developer.android.com/guide/topics/media/camera.html I have done: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); bLaunchCamera = (Button) findViewById(R.id.launchCamera); bLaunchCamera.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.d(TAG, "lanzando camara"); //create intent to launch camera Intent intent = new Intent(MediaStore.ACTION_IMAGE

Explanation of Android Code Camera Intent + Cropping Images

江枫思渺然 提交于 2019-11-29 08:42:32
When wanting to take a photo, crop and save the image in an Android application, I use the following intent in my Java... Intent camera=new Intent(); camera.setAction(MediaStore.ACTION_IMAGE_CAPTURE); camera.putExtra("crop", "true"); camera.putExtra("outputX",600); camera.putExtra("outputY", 600); camera.putExtra("aspectX", 1); camera.putExtra("aspectY", 1); camera.putExtra("scale", true); camera.putExtra("return-data", false); The above intent works great, however my Y and X are always equal. I am looking to break down the code to find out what specifies this so that I can make customisable -

How to write exif data to image in Android?

ε祈祈猫儿з 提交于 2019-11-29 07:58:59
问题 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

Capture photo rotate 90 degree in samsung mobile

北战南征 提交于 2019-11-29 07:03:59
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){ Uri contentUri = data.getData(); if(contentUri!=null) { String[] proj = { MediaStore.Images.Media.DATA

Picture coming from camera or gallery?

浪尽此生 提交于 2019-11-29 02:26:08
问题 I have an intent chooser that allows me to pick image from gallery or camera like this: Intent galleryIntent = new Intent(Intent.ACTION_GET_CONTENT,null); galleryIntent.setType("image/*"); galleryIntent.addCategory(Intent.CATEGORY_OPENABLE); Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); Intent chooser = new Intent(Intent.ACTION_CHOOSER); chooser.putExtra(Intent.EXTRA_INTENT, galleryIntent); chooser.putExtra(Intent.EXTRA_TITLE, "title"); Intent[]