android-camera-intent

Captured image returns small size

岁酱吖の 提交于 2019-12-12 04:22:29
问题 I am capturing the image from camera. The captured image's size shows too small when captured. But later if I check in gallery the captured image size shows in MB. I tried debugging the code, so while debugging I checked length of the file after image is captured the length shows 26956 bytes, and when I checked same image in gallery the size of the image is 1.3 MB. Why the image size shows reduced when captured? private void cameraIntent() { Intent intent = new Intent(MediaStore.ACTION_IMAGE

get latitude and longitude from image camera Android

不羁的心 提交于 2019-12-12 03:45:19
问题 I need to pick up the longitude and latitude of an image taken by the camera. @Override public void onClick(View v) { Intent i= new Intent("android.media.action.IMAGE_CAPTURE"); startActivityForResult(i,TAKE_PHOTO); } @Override protected void onActivityResult(int requestCode, int resultCode,Intent data){ super.onActivityResult(requestCode,resultCode,data); switch(requestCode){ case TAKE_PHOTO: Bitmap imagen =(Bitmap) data.getExtras().get("data"); Uri seleccion = (Uri) data.getExtras().get(

Camera Intent return null only on some devices

旧街凉风 提交于 2019-12-12 02:59:46
问题 I am using camera to capture image and set the returned bitmap into an imageview but it is crashing on OnePlus devices. I checked on few htc devices and it is working perfectly. I checked for solutions and they said to check for request code but I am already doing it. What can be the problem here? Here is the code imageView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);

Update Gallery after capture an image android

痞子三分冷 提交于 2019-12-12 02:43:50
问题 I try to create an app that can capture image from camera and show the result based on image path. Inside the button which handles capturing image as below btnImg.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { try { Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); file = new File(Environment.getExternalStorageDirectory() + File.separator + "Nama_foto_" + waktu + ".jpg"); intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri

Do all Android phones with a built-in camera use a folder called “DCIM” to store captured images?

你。 提交于 2019-12-12 01:28:37
问题 I am developing an app which uses the phone's default camera application to capture an image and then allow the user to perform some basic editing. I use the following snippet... Intentintent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); imageCaptureIntent.putExtra(MediaStore.EXTRA_OUTPUT,*<file>*); startActivityForResult(intent, TAKE_PHOTO_CODE); I want the image captured to be saved in a location that is consistent with the stock camera application. Can I use the DCIM folder and assume all

Is there a way to get the users current Flash settings (for the camera) in Android?

走远了吗. 提交于 2019-12-11 20:25:25
问题 Can we get the flash settings from the native camera app programmatically? I mean to say, for example, if the user meddles with the flash modes in the default camera app , I want to read the flash mode set by him on my app , which is to run in the background . Is this possible? 回答1: In order to get the current flash mode, as Mr. Harshit suggested you need to getFlashMode(). For getting the same you may use the below code Parameters params; Camera cam; cam=Camera.open(); params=cam

How to compress image using Picasso Library for Android?

孤者浪人 提交于 2019-12-11 13:48:40
问题 My Application captures Image using Camera Intent. The image is saved to a file as "abc.jpg". Now using Picasso Library I try to compress the image by resizing it. I dont get any output. My code never reaches the Target's onBitmapLoaded neither onBitmapFailed. Here is my code. public static final String DATA_PATH = Environment .getExternalStorageDirectory() + "/SnapReminder/"; File file1 = new File(DATA_PATH); file1.mkdirs(); String _path = DATA_PATH + "abc.jpg"; File file = new File(_path);

Why does the Image Picker in my Android app rotate automatically portrait images into landscape?

不羁岁月 提交于 2019-12-11 13:17:59
问题 I'm using this code in my android app to launch camera/gallery to get an Image, and display it into an ImageView. When the user picks an image with landscape orientation everythings works fine, but when the user picks a portrait image, the image is displayed rotated by 90 degrees. I can't understand why..I'm testing my app on a Galaxy S3 with Android 4.3 I've noticed that the problems only occours when the picture is taken by the phone..maybe this is a problem with the S3? This is my code:

Failed to create oat file

馋奶兔 提交于 2019-12-11 08:42:03
问题 I develop an app that intent to Camera application to take picture and save it. but my problem is : sometimes after picture taken and my app called ,my application crashed( without onActivityResult() called ). my application use multidex and I can't remove it. also instant run is enable. this is my code : protected void onActivityResult(int requestCode, int resultCode, Intent intent) { if (requestCode == REQUEST_TAKE_PHOTO) { if (resultCode == RESULT_OK) { // if intent!= null and intent

Android onActivityResult (from MediaStore.ACTION_IMAGE_CAPTURE) does not get data on Galaxy S5

偶尔善良 提交于 2019-12-11 08:36:16
问题 I am developing an application which among other things makes pictures. To take the picture I use: Intent camera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(camera, 1); My onActivityResult: public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); Image_Selecting_Task(data); if (requestCode == 1) { Image_Selecting_Task(data); } else if (requestCode == 2) { Image_Selecting_Task(data); } } public