Force Override Camera Image on Android

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:

  1. You are not taking into account the orientation of the photo, and so you are loading a landscape photo as if it were portrait.

  2. Your ImageView, or perhaps its parent, is probably misconfigured. If you want to maintain the aspect ratio of the photo, and you want that ImageView to fill some area, then the ImageView 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



Leave a reply



Submit