How to implement Camera functionality with extra options (like Panorama)?

北战南征 提交于 2019-12-21 03:43:27

问题


I am mainly interested in panorama option. Is there a way to open the native Camera app (the enhanced version), so the user can switch between normal photo and panorama view? Is it possible at all or should I stop trying?


Here is the code that I am using right now:

Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); 
startActivityForResult(i, CAMERA_REQUEST); 

This is what currently happens:

And this is what I need to achieve:


Thank you!


回答1:


Apparently, it is not yet possible to use panorama or photosphere modes directly from an application since they depend on proprietary classes provided by Google. Maybe it will be possible in the next Android API release.

See How to open camera directly in panorama/photosphere mode? or How to open photosphere camera?




回答2:


You can open paranoma mode using below code

 Intent intent = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
    startActivity(intent);



回答3:


There is no standard way to do it. AFAIK Panorama, Photoshere are proprietary features of Gallery3d (provided by Google) package com.google.android.gallery3d. It's depends on firmware of the device.

in manifest file

   <activity clearTaskOnLaunch="true" screenOrientation="0"   
   name="com.google.android.apps.lightcycle.ProtectedPanoramaCaptureActivity" 
   theme="resource_id:0x1030007" 
   configChanges="1184" 
   label="resource_id:0x7f0a00b2" 
   windowSoftInputMode="35"
   taskAffinity="com.google.android.camera">

<intent-filter>
<action name="android.intent.action.MAIN">
</action>
</intent-filter>
</activity>

in your activity

 Intent res = new Intent();
 String mPackage = "com.google.android.gallery3d";
 String mClass = "com.google.android.apps.lightcycle.ProtectedPanoramaCaptureActivity";
res.setComponent(new ComponentName(mPackage,mClass));
startActivity(res);


来源:https://stackoverflow.com/questions/22205548/how-to-implement-camera-functionality-with-extra-options-like-panorama

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!