android-camera-intent

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

断了今生、忘了曾经 提交于 2019-11-28 08:50:44
问题 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

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

☆樱花仙子☆ 提交于 2019-11-28 06:13:14
问题 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

Difference between Intent.ACTION_GET_CONTENT and Intent.ACTION_PICK

萝らか妹 提交于 2019-11-28 03:26:39
I'm trying to let the user choose any image that they want on their device to use as a wallpaper in this wallpaper application I'm building. For some reason when I write: Intent myIntent = new Intent(Intent.ACTION_PICK); myIntent.setType("image/*"); startActivityForResult(myIntent, 100); I go straight into the gallery, but when I write: Intent myIntent = new Intent(Intent.ACTION_GET_CONTENT, null); myIntent.setType("image/*"); startActivityForResult(myIntent, 100); I get to choose from Gallery, or Google Drive. What is the best way to let the user choose what app to retrieve the picture from

Explanation of Android Code Camera Intent + Cropping Images

好久不见. 提交于 2019-11-28 02:07:53
问题 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

onActivityResult returned from a camera, Intent null

大憨熊 提交于 2019-11-27 22:51:36
I follow the instruction on Camera on Android dev site I just start the Camera Intent, not build my own camera. The sample code to handle result return after taking a photo is as follows. protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE) { if (resultCode == RESULT_OK) { // Image captured and saved to fileUri specified in the Intent Toast.makeText(this, "Image saved to:\n" + data.getData(), Toast.LENGTH_LONG).show(); } else if (resultCode == RESULT_CANCELED) { // User cancelled the image capture } else { //

Camera capture orientation on samsung devices in android

南笙酒味 提交于 2019-11-27 20:44:56
I am creating a camera app. The image when captured is shown in the grid view. Now, the code is working completely fine on all the devices except for samsung devices. I am facing the orientation issue. When I capture an image in a portrait mode, the image rotates when displayed in the gridview. I have not kept any rotate code. Secondly, with the EXIF I achieved the proper image in the grid view but when the device orientation changes, again the image rotates in a wiered fashion. Attaching images: Sorry for the resolution of the image. Please lemme know if they are not visible properly. Will

Camera Intent not saving photo

回眸只為那壹抹淺笑 提交于 2019-11-27 18:35:11
I successfully have used this code snippet before, but with the file pointing to somewhere on the SD card. final File temp = new File(getCacheDir(), "temp.jpg"); temp.delete(); Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(temp)); startActivityForResult(intent, CONFIG.Intents.Actions.SELECT_CAMERA_PHOTO); However when I use getCacheDir instead of a loc on the SD card it seems the photo is never saved. Is this a limitation of cache dir and image capture? Technically, this is because writing to internal storage is not supported

Android get full size image from camera

岁酱吖の 提交于 2019-11-27 15:24:05
问题 I am developing an Android App which uploads an image from the camera or from the device photo gallery to remote site. The latter I have working fine, I can select and upload. However, I am have trouble taking a full size image and uploading. This is my code: // From onCreate Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST); I have a method to handle the Activity result. This both handles selecting

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

狂风中的少年 提交于 2019-11-27 13:03:33
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_CAPTURE); // without the following line the intent is ok takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT,

How to get Image Path just captured from camera

夙愿已清 提交于 2019-11-27 12:57:10
below is my code but is not give me image path in onActivity result Uri selectedImageUri = data.getData(); selectedImagePath = getPath(selectedImageUri); Log.w("jay", "Camera Image Path :" + selectedImagePath); Toast.makeText(MiscansOther_pannel.this, selectedImagePath, Toast.LENGTH_LONG).show(); This works for me... Code: Uri selectedImageUri = data.getData(); selectedImagePath = getRealPathFromURI(selectedImageUri); Method: getRealPathFromURI() //---------------------------------------- /** * This method is used to get real path of file from from uri * * @param contentUri * @return String */