2015-08-28 7 views
30

मैं Office Lens के स्वचालित रूप से फसल करने की क्षमता, ध्यान, और एक तस्वीर संरेखित ... मुख्य रूप से प्राप्ति और व्यय प्रसंस्करणक्या मैं अपने आवेदन में माइक्रोसॉफ्ट लेंस को एकीकृत कर सकता हूं?

के लिए मैं एक ऐप्स प्रवाह है कि इस तरह से चला जाता है करना चाहते हैं:

  1. उपयोगकर्ता मेरे ऐप को खोलता है और क्लिक करता है फोटोग्राफ रसीद
  2. लेंस को खोलता है (एंड्रॉयड मंशा, या iOS में समान)
  3. उपयोगकर्ता लेता चित्र
  4. चित्र प्रसंस्करण
  5. के लिए अपने आवेदन में लौट आता है

मुझे उस प्रवाह को होने में परेशानी हो रही है, और कैमरे और मेरे ऐप के बीच डेटा ट्रांसफर (फोटो) बनाने के लिए। आपके पास कौन से विकल्प हैं?

+0

आप किस प्रकार का ऐप बनाना चाहते हैं, क्या यह एक कार्यालय ऐड-इन या किसी अन्य प्रकार का ऐप है? आपने कार्यालय-एडिन के साथ प्रश्न टैग किया है, लेकिन मैं –

उत्तर

2

मैं 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"); 

स्रोत: Open another application from your own (intent)

+1

को दोबारा जांचना चाहता हूं, इसका मतलब है कि इस ऐप और अपने आप के बीच इंटरैक्शन। क्या आपको सच में लगता है कि वह इस कोड का उपयोग करके परिणाम का परीक्षण कर सकता है? – Vyacheslav

3

आप Androidmanifest.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> 

यदि आप इस फ़ाइल को ध्यान से पढ़ते हैं तो आप देखेंगे कि यह अन्य एपीआई के साथ बातचीत करना असंभव है। अन्य अनुप्रयोगों पर बातचीत करने के लिए 'प्रसारण' कोई उचित 'इरादा-फ़िल्टर' नहीं है।

आजकल यह असंभव है।

वैसे भी, आप स्थानीय भंडारण में सहेज सकते हैं और अपने ऐप का उपयोग करके एसडी कार्ड से डेटा पुनर्प्राप्त कर सकते हैं।

+1

तो बंद तरीका मुख्य एक्टिविटी स्क्रीन पर ऐप शुरू करना होगा और उपयोगकर्ता को अपने स्वयं के ऐप से ली गई तस्वीर साझा करने दें? – cyptus

+1

मुझे लगता है हाँ। आंतरिक/बाहरी भंडारण में साझा करें। – Vyacheslav

संबंधित मुद्दे

 संबंधित मुद्दे