Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I integrate Microsoft Lens into my application?

I like Office Lens's ability to automatically crop, focus, and align a picture... mainly for receipt and expense processing

I want to have an app flow that goes like this:

  1. User opens my app and clicks photograph receipt
  2. Lens opens (android intent, or similar in iOS)
  3. User takes picture
  4. Picture is returned to my application for processing

I am having trouble making that flow happen, and to make the data transfer (photo) between the camera and my app seamless. What options do I have?

like image 233
makerofthings7 Avatar asked Aug 28 '15 15:08

makerofthings7


People also ask

Is Office Lens and Microsoft Lens same?

Microsoft Lens (formerly “Office Lens”) is a great way to capture information from documents, whiteboards, business cards, receipts, menus, signs, handwritten memos, or anything else containing text that you want to import but not manually type out yourself.

Does Microsoft Lens have OCR?

If you want Optical Character Recognition (OCR) to be applied to your captured image, select the Word option. Microsoft Lens will create a Word file in your OneDrive account, which will automatically extract all legible text that is found in your captured image.

Is Microsoft Lens better than Adobe scan?

Office Lens is slower, and it's not as accurate as Adobe Scan, but you can crop the captured photo if you can't get the edges right. Adobe Scan supports document, business card, whiteboard, and form scan types, whereas Office Lens offers document, business card, whiteboard, and photo scanning. What is this?


1 Answers

If you look at Androidmanifest.xml file, you will see this 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> 

If you read this file carefully you will see that this is impossible to interact this the other API's. Neither 'broadcast' no proper 'intent-filter' to interact this the other applications.

This is impossible nowadays.

Anyway, obviously, you can save to local storage and retrieve the data from SD card using your app.

like image 194
Vyacheslav Avatar answered Sep 27 '22 22:09

Vyacheslav