android-camera

Updating gallery after taking pictures Gallery not showing all the pictures Android Camera

情到浓时终转凉″ 提交于 2019-12-18 07:06:10
问题 I am using a onClick over a button to capture an image. PictureCallback myPictureCallback_JPG = new PictureCallback() { @Override public void onPictureTaken(byte[] arg0, Camera arg1) { FileOutputStream outStream = null; try { // Write to SD Card outStream = new FileOutputStream(String.format("/sdcard/%d.jpg", System.currentTimeMillis())); outStream.write(arg0); outStream.close(); Toast.makeText(Photo.this, "Image Saved to SD Card", Toast.LENGTH_SHORT).show(); System.out.println(); } catch

Force portrait mode in camera

让人想犯罪 __ 提交于 2019-12-18 06:12:02
问题 I am invoking a camera using an intent and clicking a picture. Presently I am on emulator and would like to force camera to click the pictures in portrait mode(need to capture a video of app working,so orientation change would look bad) but the camera screen appears landscape and all the further activities which I invoke in onActivityResult(). After clicking the picture the Activity layout comes out in landscape mode like this: while all my previous activity have displayed correctly in

Capture photo rotate 90 degree in samsung mobile

戏子无情 提交于 2019-12-18 04:50:32
问题 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){

How to capture screenshot of camera preview with overlay?

南笙酒味 提交于 2019-12-18 04:27:12
问题 I saw the following link for the above query but both the answers does not met the expectation. [How to programmatically take a screenshot in Android? Expectation: Capture camera preview with overlay. 回答1: I provided solution to a folk, please check this answer. He had trouble to get the result but copied code below is what I'm using in production since a year ago. please try it. The code captures image in SurfaceView which is given from Camera . You can overlay some views on it. They will be

update android image gallery with newly created bitmap

故事扮演 提交于 2019-12-18 04:24:11
问题 I'm trying to save an image file to external storage. I can save the picture to the sdcard but it doesn't show up in Androids gallery application. I've tried this approach: File path = Environment.getExternalStorageDirectory(); File f = new File(path + "/mydirectory/" + imageName + "_" + System.currentTimeMillis() + ".jpg"); FileOutputStream fos = new FileOutputStream(f); f.mkdirs(); b.compress(CompressFormat.JPEG, 100, fos); fos.close(); Uri contentUri = Uri.fromFile(f); Intent

It seems that your device does not support camera(or it is locked)

人盡茶涼 提交于 2019-12-18 03:56:41
问题 Android opencv samples and tutorials were running fine and suddenly one day I get this for all of those: "It seems that your device does not support camera (or it is locked). The application will be closed" Please help, how to I can fix it? I have reinstalled opencv and imported again and made new emulators but the problem still persists. 回答1: Go to your device settings -> apps -> YOUR APP -> Permissions -> turn on camera permission.. Worked for me.. 回答2: Check the camera permission in

Android capturing slow motion video

半腔热情 提交于 2019-12-18 03:30:12
问题 How can i capture slow motion video in my app? I tried using mMediaRecorder.setVideoFrameRate(100); but app crashes if i set the value 20 or more with IllegalStateException . I have researched a lot.Normal video is between 24 and 30 fps.To see slow motion video we need to capture 100-120 fps but device does not allow that.But I see the default camera in my device has an option of Slow motion.Also few apps in play store allow to create slow motion videos.I also tried setting higher

getSupportedPictureSize() returns a value which is not actually supported by Nexus4

…衆ロ難τιáo~ 提交于 2019-12-18 01:20:27
问题 I have extended a SurfaceView for displaying the camera feed for a very simple camera application. To find the optimal preview size for each device, I used this sample code which is used in almost all the open source camera apps I have seen: List<Camera.Size> sizes = parameters.getSupportedPreviewSizes(); double minDiff = Double.MAX_VALUE; for (Camera.Size size : sizes) { if (Math.abs(size.width - width) < minDiff) { screenWidth = size.width; screenHeight = size.height; minDiff = Math.abs

Camera Force Closing issue in Samsung Galaxy S3 version 4.1.1

烂漫一生 提交于 2019-12-18 01:06:08
问题 I want to capture image and save it in Image view in one of My Application. I already have an idea how to implement it and also Works fine in all device Except Samsung Galaxy S3. What I Want: Avoid the Force Closing Issue Coming in Samsung Galaxy S3 and probably for all other Device which i have not yet tested. What I have Done: I have Done the Below Code to achieve my goal. BuildInukshk_4 Activity : package com.inukshk.CreateInukshk; import java.util.Calendar; import android.app.Activity;

android camera portrait orientation

只谈情不闲聊 提交于 2019-12-18 01:05:48
问题 I am using camera in my app. I am just using intent to start camera Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri); startActivityForResult(cameraIntent, 101); The captured image automatically comes in landscape view . How do i make camera to capture images in portrait view 回答1: If device has v2.2 or above you can rotate camera orientation to portrait using camera.setDisplayOrientation(90) . In