android-camera

Launch default camera app (no return)

拈花ヽ惹草 提交于 2019-12-28 04:08:16
问题 I'd like to launch the default camera, but want it to act like it was started from the launcher (i.e. the resulting picture should be stored by the camera app to the user's gallery, rather than being returned to my app). If I use Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); , the camera app uses the "OK? Retry?"-UI and doesn't save the picture. I'd rather not use a "direct" com.android.camera intent, because a lot of devices use custom camera apps. I've

Android: how to display camera preview with callback?

断了今生、忘了曾经 提交于 2019-12-28 03:46:09
问题 What I need to do is quite simple, I want to manually display preview from camera using camera callback and I want to get at least 15fps on a real device. I don't even need the colors, I just need to preview grayscale image. Images from camera are in YUV format and you have to process it somehow, which is the main performance problem. I'm using API 8. In all cases I'm using camera.setPreviewCallbackWithBuffer(), that is faster than camera.setPreviewCallback(). It seems that I cant get about

Turn ON/OFF Camera LED/flash light in Samsung Galaxy Ace 2.2.1 & Galaxy Tab

孤者浪人 提交于 2019-12-28 02:44:14
问题 I am turning ON Camera LED light using FLASH_MODE_ON . Samsung Galaxy Ace have only three flash modes : on, off and auto. FLASH_MODE_TORCH not working in Samsung Galaxy Tab & Samsung Galaxy Ace 2.2.1 Here is my code how i am turning ON my Camera LED Camera cam; cam = Camera.open(); Parameters params = cam.getParameters(); params.setFlashMode(Parameters.FLASH_MODE_ON); cam.setParameters(params); cam.startPreview(); cam.autoFocus(new AutoFocusCallback() { public void onAutoFocus(boolean success

Custom camera android

六月ゝ 毕业季﹏ 提交于 2019-12-27 12:44:04
问题 I want to use camera preview in an activity. I want to add images(transparent frames on surface view). I tried following code so that i can easily customize the xml layout desirably: package com.demo; import java.io.IOException; import android.app.Activity; import android.graphics.PixelFormat; import android.hardware.Camera; import android.os.Bundle; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.widget.Toast; public class CameraDemoActivity extends

Get Path of image from ACTION_IMAGE_CAPTURE Intent

扶醉桌前 提交于 2019-12-27 11:04:21
问题 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

What should i do so that camera work everytime?

只谈情不闲聊 提交于 2019-12-25 18:48:17
问题 I am using camera service in my application. Sometimes the camera service is running fine in the application and sometimes it gives a runtime exception. I have put Camera.Open() in try block and i have catched the exception and its showing in log cat 03-12 13:52:42.211: D/crazy(12686): in catch1 03-12 13:52:42.211: D/crazy(12686): java.lang.RuntimeException: Fail to connect to camera service The code that i done is... TelephonyManager mgr = (TelephonyManager) getSystemService(Context

Open Camera in a blank surfaceView

耗尽温柔 提交于 2019-12-25 18:37:05
问题 I am very new to android programming and All I want to do is open camera app in surface view so that I can open camera into it and set some parameters like following? Camera camera = Camera.open(); Parameters p = camera.getParameters(); p.setFlashMode(Parameters.FLASH_MODE_ON); camera.setParameters(p); camera.startPreview(); camera.release(); I came across comments saying that I HAVE to pass a surface. so I have created following surface: package com.example.fcloader; import java.io

android crop image from gallery nullpointexception

こ雲淡風輕ζ 提交于 2019-12-25 16:53:50
问题 I'm working in Camera.i want to choose image from my gallery and crop selected photo and then show it in my imageview.i wrote some code but i have problem in cropping. this is a my error Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.Uri.getScheme()' on a null object reference private void CropPictureFromGallery() { Intent pickImageIntent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);

How i can correctly set up CONTROL_SCENE_MODE_ACTION camera2API?

与世无争的帅哥 提交于 2019-12-25 16:50:56
问题 I need to set up CONTROL_SCENE_MODE_ACTION for my app camera2API. i tryed to set it captureStillPicture() method then in lockFocus() method then in stateCallback but is doesn't work... In documentation i found only explanation what it is, but any lines how this mode have to be set up... There are 2 question: Where exacly i have to set up this mode How i can check that it is working Or maybe you can suggest me how to reduse expose time... Thanks in advance 回答1: You can modify

android- performing crop image is not working properly

一曲冷凌霜 提交于 2019-12-25 09:01:58
问题 I'm working with android crop image , this is my code for cropping image : private void performCrop() { try { Intent cropIntent = new Intent("com.android.camera.action.CROP"); //indicate image type and Uri cropIntent.setDataAndType(picUri, "image/*"); //set crop properties cropIntent.putExtra("crop", "true"); //indicate aspect of desired crop cropIntent.putExtra("aspectX", 1); cropIntent.putExtra("aspectY", 1); //indicate output X and Y cropIntent.putExtra("outputX", 500); cropIntent.putExtra