我喜欢Office Lens的能力,自动裁剪,突出重点,并调整图片...主要用于接收和处理费用我可以将微软镜头集成到我的应用程序中吗?
我想有一个是这样的一个应用程序流程:
- 用户打开我的应用程序,并单击照片回执
- 镜头打开(Android的意图,或在iOS的类似)
- 用户拍摄图片
- 图片返回到我的应用程序进行处理
我遇到麻烦使流动发生,并使相机和我的应用程序之间的数据传输(照片)无缝。我有什么选择?
我喜欢Office Lens的能力,自动裁剪,突出重点,并调整图片...主要用于接收和处理费用我可以将微软镜头集成到我的应用程序中吗?
我想有一个是这样的一个应用程序流程:
我遇到麻烦使流动发生,并使相机和我的应用程序之间的数据传输(照片)无缝。我有什么选择?
我已经采取了这样的回答从Anonsage
/** Open another app.
* @param context current Context, like Activity, App, or Service
* @param packageName the full package name of the app to open
* @return true if likely successful, false if unsuccessful
*/
public static boolean openApp(Context context, String packageName) {
PackageManager manager = context.getPackageManager();
try {
Intent i = manager.getLaunchIntentForPackage(packageName);
if (i == null) {
return false;
//throw new PackageManager.NameNotFoundException();
}
i.addCategory(Intent.CATEGORY_LAUNCHER);
context.startActivity(i);
return true;
} catch (PackageManager.NameNotFoundException e) {
return false;
}
}
要拨打办公室镜头简单地写
openApp(this, "com.microsoft.office.officelens");
他意味着这个应用程序和他自己的应用程序之间的互动。你真的认为他可以用这个代码来处理结果吗? – Vyacheslav
如果你看一下Androidmanifest.xml
文件,你会看到这个XML:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.microsoft.office.officelens" platformBuildVersionCode="21" platformBuildVersionName="5.0.1-1624448">
<uses-permission android:name="android.permission.CAMERA" android:required="true"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>
<uses-permission android:name="android.permission.ACCESS_DOWNLOAD_MANAGER"/>
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.READ_PROFILE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
<uses-feature android:name="android.hardware.camera" android:required="true"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
<application android:allowBackup="true" android:icon="@drawable/ic_officelens" android:label="@string/officelens_app_name" android:largeHeap="true" android:name="com.microsoft.office.officelens.OfficeLensApplication" android:theme="@style/OfficeLensAppTheme">
<activity android:label="@string/officelens_app_name" android:name="com.microsoft.office.apphost.LaunchActivity" android:theme="@style/OfficeLensSplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:configChanges="orientation|screenSize" android:label="@string/officelens_app_name" android:launchMode="singleTask" android:name="com.microsoft.office.officelens.MainActivity" android:theme="@style/FullscreenTheme"/>
<activity android:label="@string/officelens_app_name" android:name="com.microsoft.office.officelens.SecureActivity" android:parentActivityName="com.microsoft.office.officelens.MainActivity" android:windowSoftInputMode="stateHidden"/>
<activity android:label="@string/title_activity_settings" android:name="com.microsoft.office.officelens.SettingsActivity" android:parentActivityName="com.microsoft.office.officelens.MainActivity"/>
<activity android:configChanges="orientation|screenSize" android:label="" android:name="com.microsoft.office.officelens.AboutActivity" android:parentActivityName="com.microsoft.office.officelens.SettingsActivity"/>
<activity android:label="" android:name="com.microsoft.office.officelens.FirstRunActivity" android:parentActivityName="com.microsoft.office.officelens.MainActivity" android:screenOrientation="portrait" android:theme="@style/OfficeLensFirstRunTheme"/>
<activity android:label="@string/title_activity_section_picker" android:name="com.microsoft.onenote.pickerlib.OneNotePickerActivity" android:theme="@style/Theme.AppCompat.Light"/>
<activity android:exported="false" android:icon="@drawable/ms_logo" android:label="@string/webflow_header" android:name="com.microsoft.onlineid.authenticator.AccountAddPendingActivity" android:theme="@style/Theme.MSA"/>
<activity android:configChanges="orientation|screenSize" android:exported="false" android:icon="@drawable/ms_logo" android:label="@string/webflow_header" android:name="com.microsoft.onlineid.internal.ui.WebWizardActivity" android:theme="@style/Theme.MSA" android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="com.microsoft.onlineid.internal.SIGN_IN"/>
<action android:name="com.microsoft.onlineid.internal.RESOLVE_INTERRUPT"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<activity android:configChanges="orientation|screenSize" android:exported="false" android:icon="@drawable/ms_logo" android:label="@string/webflow_header" android:name="com.microsoft.onlineid.ui.AddAccountActivity" android:theme="@style/Theme.MSA" android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="com.microsoft.onlineid.internal.ADD_ACCOUNT"/>
<action android:name="com.microsoft.onlineid.internal.SIGN_UP_ACCOUNT"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<activity android:configChanges="orientation|screenSize" android:exported="false" android:name="com.microsoft.onlineid.ui.SignOutActivity" android:theme="@style/Theme.MSA.Transparent"/>
<activity android:exported="false" android:icon="@drawable/ms_logo" android:label="@string/webflow_header" android:name="com.microsoft.onlineid.internal.ui.AccountPickerActivity" android:theme="@style/Theme.MSA.Dialog">
<intent-filter>
<action android:name="com.microsoft.onlineid.internal.PICK_ACCOUNT"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<service android:exported="false" android:name="com.microsoft.onlineid.internal.MsaService">
<intent-filter>
<action android:name="com.microsoft.onlineid.internal.GET_TICKET"/>
<action android:name="com.microsoft.onlineid.internal.UPDATE_PROFILE"/>
<action android:name="com.microsoft.onlineid.internal.SIGN_OUT"/>
<action android:name="com.microsoft.onlineid.internal.SIGN_OUT_ALL_APPS"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</service>
<service android:enabled="true" android:exported="false" android:name="com.microsoft.onlineid.sso.service.MsaSsoService">
<intent-filter>
<action android:name="com.microsoft.msa.action.SSO_SERVICE"/>
</intent-filter>
<meta-data android:name="com.microsoft.msa.service.sso_version" android:value="1"/>
<meta-data android:name="com.microsoft.msa.service.sdk_version" android:value="@string/sdk_version_name"/>
</service>
</application>
<uses-permission android:name="com.android.vending.CHECK_LICENSE"/>
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>
<uses-permission android:name="android.permission.USE_CREDENTIALS"/>
<uses-feature android:name="android.hardware.telephony" android:required="false"/>
</manifest>
如果您仔细阅读此文件,您会发现无法与其他API进行交互。 “广播”没有适当的“意图过滤器”来与其他应用程序进行交互。
现在这是不可能的。
无论如何,显然,您可以保存到本地存储并使用您的应用程序从SD卡检索数据。
所以封闭的方式将启动在MainActivity屏幕上的应用程序,并让用户与我自己的应用程序分享拍摄的照片? – cyptus
我认为是的。共享内部/外部存储。 – Vyacheslav
你想构建什么样的应用程序,这是一个办公室外接程序或其他类型的应用程序?你已经用office-addins标记了这个问题,但我想仔细检查 –