android-camera-intent

Android - Save images in an specific folder

人走茶凉 提交于 2019-11-26 10:32:15
问题 I need to save the pictures taken with my app in an specific folder. I\'ve read many solutions to this problem but I couldn\'t make any of them work so I ask for help. MainActivity.java public void onClick(View v) { Intent camera = new Intent( android.provider.MediaStore.ACTION_IMAGE_CAPTURE); //Folder is already created String dirName = Environment.getExternalStorageDirectory().getPath() + \"/MyAppFolder/MyApp\" + n + \".png\"; Uri uriSavedImage = Uri.fromFile(new File(dirName)); camera

broadcast receiver won't receive camera event

只谈情不闲聊 提交于 2019-11-26 09:18:14
问题 I\'m trying to make an app that detects when a user takes a photo. I set up a broadcast receiver class and registered it in the manifest file by: <receiver android:name=\"photoReceiver\" > <intent-filter> <action android:name=\"com.android.camera.NEW_PICTURE\"/> <data android:mimeType=\"image/*\"/> </intent-filter> </receiver> No matter what I try to do the program won\'t receive the broadcast. Here is my receiver class: public class photoReceiver extends BroadcastReceiver { private static

How to compress image size?

送分小仙女□ 提交于 2019-11-26 09:01:27
问题 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? 回答1: 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

Android - Taking photos and saving them with a custom name to a custom destination via Intent

若如初见. 提交于 2019-11-26 08:22:17
问题 I have a program that opens the camera via Intent to take a photo. That much part works fine already. However, I want it to save to a certain folder with a certain file name (the file name is optional but it would really really help). So here\'s what I have so far. Here\'s the line of code that opens the camera: //TODO camera stuff. Intent openCam = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); //The two lines of code below were commented out at first. //They were eventually added when I tried

Intent does not set the camera parameters

人盡茶涼 提交于 2019-11-26 07:48:41
问题 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

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

我只是一个虾纸丫 提交于 2019-11-26 06:58:41
问题 This question already has answers here : Why does an image captured using camera intent gets rotated on some devices on Android? (21 answers) Closed last year . 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

Getting path of captured image in Android using camera intent

爷,独闯天下 提交于 2019-11-26 04:20:54
问题 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,

Android: Activity getting Destroyed after calling Camera Intent

泄露秘密 提交于 2019-11-26 02:35:56
问题 I am having two Activities (A1 , A2). A1 calls A2 and from A2 i am calling the camera intent as below launchIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); launchIntent.putExtra(MediaStore.EXTRA_OUTPUT,photoPath); startActivityForResult(launchIntent,CAMERA_REQUEST); It opens the camera, and i can take the picture. But the Problem arises once i click the save button (tick button in s3), my onActivityResult is not called instead A2\'s onDestroy method is called. I have

How to capture an image and store it with the native Android Camera

纵然是瞬间 提交于 2019-11-26 02:30:46
问题 I am having a problem capturing an image and storing it from the native camera app. Here is a sample of some of my code. _path = Environment.getExternalStorageDirectory() + \"make_machine_example.jpg\"; File file = new File( _path ); Uri outputFileUri = Uri.fromFile( file ); Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE ); intent.putExtra( MediaStore.EXTRA_OUTPUT, outputFileUri ); startActivityForResult( intent, 0 ); After the picture has been taken and I\'m

Android camera intent

守給你的承諾、 提交于 2019-11-26 01:27:38
问题 I need to push an intent to default camera application to make it take a photo, save it and return an URI. Is there any way to do this? 回答1: private static final int TAKE_PICTURE = 1; private Uri imageUri; public void takePhoto(View view) { Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); File photo = new File(Environment.getExternalStorageDirectory(), "Pic.jpg"); intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo)); imageUri = Uri.fromFile(photo); startActivityForResult