Force override camera image on android
The camera implementation is completely native, everything works with IPC calls between the system and the camera driver (that are provided by the different manufactor).
There is no way to intercept this chain without recompiling the entire OS.
You can find more info here.
Can I force my application to launch the default Camera rather than offering the 'Complete action using' list?
I'm not sure what you are trying to accomplish is portable across all devices. One goal of Android is to allow the easy replacement of activities that service requests such as image capture. That being said, if you only wish to do this for your device, you could simply set the component name in the intent to the media capture activity's name.
Android emulator camera custom image
Download the source from following url . This is work as the another Gallery in the emulator.
While passing intent to capture image from camera choose this gallery. this is looks like samsung mobile 3d gallery.. this will return the default images.. in emulators . one more thing it will work fine after 3.0 versions only.
https://github.com/c-jiang/Gallery3D-Mod
How to set Android default camera app for portrait orientation only
how may I lock camera app only for portrait
You don't. You did not write the camera app, as there are hundreds, perhaps thousands, of camera apps. It is up to the camera app and the user to handle orientation.
Besides:
on many devices, you will have the same problem in portrait mode
your landscape photo also appears to be stretched, though not as drastically
But if I captured a photo from landscape the taken image would set in screen with stretched
You have one, and perhaps two, problems:
You are not taking into account the orientation of the photo, and so you are loading a landscape photo as if it were portrait.
Your
ImageView
, or perhaps its parent, is probably misconfigured. If you want to maintain the aspect ratio of the photo, and you want thatImageView
to fill some area, then theImageView
needs to have that same aspect ratio.
If you really want to only take photos in portrait mode, you would need to use android.hardware.Camera
yourself, rather than launching a third-party camera app, in addition to addressing the problems I mention above.
Allow user to select camera or gallery for image
You'll have to create your own chooser dialog merging both intent resolution results.
To do this, you will need to query the PackageManager with PackageManager.queryIntentActivities() for both original intents and create the final list of possible Intents with one new Intent for each retrieved activity like this:
List<Intent> yourIntentsList = new ArrayList<Intent>();
List<ResolveInfo> listCam = packageManager.queryIntentActivities(camIntent, 0);
for (ResolveInfo res : listCam) {
final Intent finalIntent = new Intent(camIntent);
finalIntent.setComponent(new ComponentName(res.activityInfo.packageName, res.activityInfo.name));
yourIntentsList.add(finalIntent);
}
List<ResolveInfo> listGall = packageManager.queryIntentActivities(gallIntent, 0);
for (ResolveInfo res : listGall) {
final Intent finalIntent = new Intent(gallIntent);
finalIntent.setComponent(new ComponentName(res.activityInfo.packageName, res.activityInfo.name));
yourIntentsList.add(finalIntent);
}
(I wrote this directly here so this may not compile)
Then, for more info on creating a custom dialog from a list see https://developer.android.com/guide/topics/ui/dialogs.html#AlertDialog
Android Camera force close after capturing on KitKat
I've found solution for intent camera force close on KitKat by trial and error.
Seems I don't need FileProvider at all.
I change storageDir in my createImageFile() to this :
File storageDir = getExternalFilesDir("Pictures");
And photoURI to this :
Uri photoURI = Uri.fromFile(photoFile);
Now I have the right fullscreen image to display on KitKat too.
And I remove provider from my manifest. Now I have my captured image file at Android/data/my.package.name/files/Pictures/ folder.
Related Topics
Android Sdk Is Mssing ,Out of Date or Corrupted
Android Volley - Basicnetwork.Performrequest: Unexpected Response Code 400
Getting Simple Json Object Response Using Retrofit Library
Android Studio: Emulator Is Running But Not Showing Up in Run App "Choose a Running Device"
How to Change the Default Height of a Bottomsheetdialog
Fragment Is Not Being Replaced But Put on Top of the Previous One
How to Implement My Custom Toolbar in My Fragment
Fastest Way to Upload Multiple Image to Server in Android
Is Quitting an Application Frowned Upon
How to Connect Localhost in the Android Emulator
Waiting Till the Async Task Finish Its Work
Full Screen Without Navigation & Status Bars
How to Convert Image to Zpl Code for Printing Using Zebra Printer
Socket.Io Client Getting Connected Disconnected Repeatedly
React-Native: Module Appregistry Is Not a Registered Callable Module
Apk Installation Failed: [Install_Failed_Verification_Failure]