android-camera-intent

How to add gallery button to Camera open with intent?

∥☆過路亽.° 提交于 2019-12-24 04:40:53
问题 In my app users are able to make a photo with camera. And I start it using intents: Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); Now when open camera lacks the gallery button which would allow user to pick one of existing images from his SD card. Is it possible to show this button? 回答1: You can't really change the things camera intent has to offer, and if you do find a device where the camera app would let you access the gallery I wouldn't depend on it. I would recommend that

Null Pointer Exception when grabbing picture from Gallery

眉间皱痕 提交于 2019-12-24 01:37:09
问题 i have the following code, which is used to grab images (either from camera or gallery) and then display it on an ImageView: @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if(resultCode == RESULT_OK) { if(requestCode == 1888) { final boolean isCamera; if(data == null) { isCamera = true; } else { final String action = data.getAction(); if(action == null) { isCamera = false; } else { isCamera = action.equals(android.provider.MediaStore.ACTION_IMAGE

Cannot get camera preview (call camera) , HTC Thunderbolt

╄→гoц情女王★ 提交于 2019-12-23 23:35:51
问题 I am new to android app development so please any answers would be great with code examples. My problem is this, I have to develop a camera app that streams mjpeg to a server. Now I have successfully created the app for my Motorola Atrix and that works great. My problem is after I signed and exported that app and installed it on an HTC Thunderbolt for additional device testing, I found that it freezes when I try to call for the camera and the app crashes. Since then I have tried every example

Android add text to Picture and save

时光总嘲笑我的痴心妄想 提交于 2019-12-23 18:08:37
问题 I want to place a Textiew to my picture and save it, but I'm not sure how to insert the text into the picture. I can attach an image on my picture save it, and it works but now I want to insert a Textiew into the picture. Here is my code: PictureCallback cameraPictureCallbackJpeg = new PictureCallback() { @Override public void onPictureTaken(byte[] data, Camera camera) { // TODO Auto-generated method stub Bitmap cameraBitmap = BitmapFactory.decodeByteArray(data, 0, data.length); wid =

How to control video capture properties in android?

陌路散爱 提交于 2019-12-23 15:52:17
问题 I am capturing video using the following intent: Intent takeVideoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE); if (takeVideoIntent.resolveActivity(getPackageManager()) != null) { takeVideoIntent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1); takeVideoIntent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 10); startActivityForResult(takeVideoIntent, VIDEO_CAPTURE_INTENT); } I need to control two things, first its frames sizes with the given height/width and secondly I want to capture the video

onActivityResult doesn't call from viewPager fragment

家住魔仙堡 提交于 2019-12-23 10:09:11
问题 Hi I am using viewPager with fragmnets inside main fragment. I am trying to get image to bitmap from gallery or from camera, but after picking photo and startActivityForResult it doesn't catch in onActivityResult... here is how i call startActivityForResult: private void setAvatarDialog(){ final CharSequence[] options = {"Choose from Gallery", "Take Photo" }; String title = getString(R.string.alertDialog_editProfile_updateAvatar_title); String negative = getString(R.string.alertDialog

Picture file captured with camera intent empty for a while in onActivityResult

删除回忆录丶 提交于 2019-12-23 09:28:05
问题 I am having a very strange bug trying to take a picture via intent. Activity code (a little simplified): private void startCapture() throws IOException { // Create output file final File photoFile = makePhotoFile(); _photoPath = photoFile.getAbsolutePath(); Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); /* IMPORTANT NOTE TO READERS * As of Android N (which went out shortly after I posted this question), * you cannot use Uri.fromFile this way anymore. * You should use a

Get uri of picture taken by camera

你。 提交于 2019-12-23 03:17:35
问题 When the user takes a picture with the camera, I want the image displayed in an ImageView and I want to save the Uri to an online database. I heard saving the Uri of a picture is better than saving the path. So this is how I start the camera: intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(getFile(getActivity()))); String a = String.valueOf(Uri.fromFile(getFile(getActivity()))); intent.putExtra("photo_uri", a); startActivityForResult(intent, PICK_FROM_CAMERA); where private File getFile

What data is returned when using ACTION_IMAGE_CAPTURE?

Deadly 提交于 2019-12-22 10:27:56
问题 I'm getting a bit confused from this description: The caller may pass an extra EXTRA_OUTPUT to control where this image will be written. If the EXTRA_OUTPUT is not present, then a small sized image is returned as a Bitmap object in the extra field. This is useful for applications that only need a small image. If the EXTRA_OUTPUT is present, then the full-sized image will be written to the Uri value of EXTRA_OUTPUT. With NO EXTRA_OUTPUT , it will return a "small sized image"? With EXTRA_OUTPUT

Android Camera Intent - Out Of Memory Error and Rotation Error

五迷三道 提交于 2019-12-22 09:49:27
问题 I'm creating an android app that utilizes the camera to take pictures and then sends them to a server based on user input. I'm currently having some problems with the camera intent. My main problems are : Getting a picture that seems to be rotated when compared to the position it was taken. When I try to fix this Rotation I get an OutOfMemoryError So mainly I need to make sure that the orientation of the picture doesn't change and that I don't get an OutOfMemoryError. Here is the function