-1

I am an Android developer trying to get our app working on Xperia Z2 tablet.

Our app has a functionality to allow the user to take pictures using 'Camera' app which comes by default on Android device. The functionality works fine, except after we take a picture, the ‘Camera’ app does not let the user to preview the picture before returning to our app. It goes back to our app immediately after we take the picture.

We noticed there is a setting on the Sony Xperia Z2 'Camera' app to set ‘Preview’ time to either ‘Unlimited’, ‘5 seconds’, ‘3 seconds’, ‘Edit’, or ‘Off’. This setting doesn’t seem to be accessible when the ‘Camera’ app is opened from our app.

Is there any way for us to allow the user to access this preview setting, or at least programmatically set the preview time on the ‘Camera’ app from our app?

Below are the codes we are using to open the 'Camera' app.

    // Camera.
    final List<Intent> cameraIntents = new ArrayList<Intent>();
    final Intent captureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    final PackageManager packageManager = mActivity.getPackageManager();
    final List<ResolveInfo> listCam = packageManager.queryIntentActivities(captureIntent, 0);
    for(ResolveInfo res : listCam) {
        final String packageName = res.activityInfo.packageName;
        final Intent intent = new Intent(captureIntent);
        intent.setComponent(new ComponentName(res.activityInfo.packageName, res.activityInfo.name));
        intent.setPackage(packageName);
        intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(f));
        cameraIntents.add(intent);
    }
    // Filesystem.
    final Intent galleryIntent = new Intent();
    galleryIntent.setType("image/*");
    galleryIntent.setAction(Intent.ACTION_GET_CONTENT);

    // Chooser of filesystem options.
    final Intent chooserIntent = Intent.createChooser(galleryIntent, "Select Source");

    // Add the camera options.
    chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, cameraIntents.toArray(new Parcelable[]{}));

    mActivity.startActivityForResult(chooserIntent, PHOTO_REQUEST_CODE);

Additional information: The app is not going to be available for public to use. It will be used internally inside a company. Hence we will have control over which tablet the app is going to be installed on. Feel free to answer with solutions that only applies strictly to the Sony Xperia tablet.

Your help is appreciated.

LinRuZeng
  • 3
  • 3

1 Answers1

0

Unfortunately the preview time setting functionality is not available in a public API.

One possible solution could be to just show the preview image from within your app. Should not be too hard to implement.

mldeveloper
  • 2,253
  • 1
  • 13
  • 14
  • I see. Thanks for your clarification and suggested solution. The camera app in the old tablet that the company uses had the preview functionality by default so I thought it should also be possible in the new Sony Xperia tablet. :) – LinRuZeng Jul 08 '14 at 00:42