android-camera-intent

android force camera to take photo in landscape mode

半城伤御伤魂 提交于 2019-11-26 22:06:14
问题 I want to force the default android camera to take photo in landscape mode only. I have tried following: Intent cameraIntent=new Intent("android.media.action.IMAGE_CAPTURE"); File photo = new File(Environment.getExternalStorageDirectory().getAbsolutePath(), "Pic.jpg"); cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo)); cameraIntent.putExtra(MediaStore.EXTRA_SCREEN_ORIENTATION, ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); startActivity(cameraIntent); but this works only in 2.1

Camera intent for ACTION_IMAGE_CAPTURE does not appear on Samsung Galaxy Nexus(4.0.2)

若如初见. 提交于 2019-11-26 21:25:43
问题 I use following code take a Picture from camera and to obtain picture's path. ... Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(cameraIntent, CAMERA_IMAGE_CAPTURE); // image capture ... @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); Log.d(TAG, "onActivityResult:" + resultCode + " request:" + requestCode); switch (requestCode) { case

Intent does not set the camera parameters

本小妞迷上赌 提交于 2019-11-26 21:06:38
I am opening camera app as external intent from my applications. I am using following code to invoke the camera and following are my conditions: It should open the front camera. Highest picture quality. Flash light has to be on Following is my code: Intent action = new Intent("android.media.action.IMAGE_CAPTURE"); action.putExtra("android.intent.extras.CAMERA_FACING", 1); action.putExtra("android.intent.extras.FLASH_MODE_ON", 1); action.putExtra("android.intent.extras.QUALITY_HIGH", 1); Now, it does open the front camera BUT it does not turn on the flash and it does not set the picture quality

How to compress image size?

 ̄綄美尐妖づ 提交于 2019-11-26 20:27:06
I want to capture image in low resolution using android camera api but when I captured image it will take default resolution of device camera.So I want to capture image in low resolution or small size at time of capture or how can I compress big image into small size in android? You can create bitmap with captured image as below: Bitmap bitmap = Bitmap.createScaledBitmap(capturedImage, width, height, true); Here you can specify width and height of the bitmap that you want to set to your ImageView. The height and width you can set according to the screen dpi of the device also, by reading the

Android Camera Intent Saving Image Landscape When Taken Portrait [duplicate]

我与影子孤独终老i 提交于 2019-11-26 19:29:52
This question already has an answer here: Why does an image captured using camera intent gets rotated on some devices on Android? 18 answers I have had a look around but there doesn't seem to be a solid answer/solution to the, very irritating, problem. I take a picture in portrait orientation and when I hit save/discard the buttons are in the correct orientation also. The problem is when I then retrieve the image later on it is in landscape orientation (the picture has been rotated 90 degrees anti-clockwise) I don' want to force the user to use the camera in a certain orientation. Is there a

Difference between Intent.ACTION_GET_CONTENT and Intent.ACTION_PICK

隐身守侯 提交于 2019-11-26 18:59:03
问题 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

Getting path of captured image in Android using camera intent

做~自己de王妃 提交于 2019-11-26 15:18:43
I have been trying to get path of captured image in order to delete image. Found many answers on StackOverflow but none of them are working for me. I got the following answer: private String getLastImagePath() { final String[] imageColumns = { MediaStore.Images.Media._ID, MediaStore.Images.Media.DATA }; final String imageOrderBy = MediaStore.Images.Media._ID + " DESC"; Cursor imageCursor = POS.this.getContentResolver().query( MediaStore.Images.Media.EXTERNAL_CONTENT_URI, imageColumns, null, null, imageOrderBy); if (imageCursor.moveToFirst()) { // int id = imageCursor.getInt(imageCursor //

Camera orientation issue in Android

不羁岁月 提交于 2019-11-26 14:55:31
I am building an application that uses camera to take pictures. Here is my source code to do this: File file = new File(Environment.getExternalStorageDirectory(), imageFileName); imageFilePath = file.getPath(); Intent intent = new Intent("android.media.action.IMAGE_CAPTURE"); //Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file)); startActivityForResult(intent, ACTIVITY_NATIVE_CAMERA_AQUIRE); On onActivityResult() method, I use BitmapFactory.decodeStream() to pickup the image. When I run my application on Nexus one, it runs

Picture taken with camera intent is low quality on ImageView (7.0+) [duplicate]

a 夏天 提交于 2019-11-26 14:53:47
问题 This question already has answers here : Low picture/image quality when capture from camera (2 answers) Closed 3 months ago . I know there are lots of examples of this, but I haven't found a solid example that works with 7.0+. I know that I am setting the thumbnail of the image rather than the original, but I am not sure how to get it. Here is my code: if( ContextCompat.checkSelfPermission(this, android.Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) { if (Build.VERSION.SDK

Get Path of image from ACTION_IMAGE_CAPTURE Intent

末鹿安然 提交于 2019-11-26 14:34:05
Hi I am using ACTION_IMAGE_CAPTURE for capturing image using Intent as follows: Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); cameraIntent.putExtra( MediaStore.EXTRA_OUTPUT, (new File(Environment.getExternalStorageDirectory(), String.valueOf(System.currentTimeMillis()) + ".jpg")) ); startActivityForResult(cameraIntent, 0); I need to store image in an sdcard and retrieve the path of that image using the onActivityResult method. I don't know how to get the image path of the currently captured image. If any one knows please help. Thanks Zelimir This is how it works on 2.2