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:
User opens my app and clicks photograph receipt
Lens opens (android intent, or similar in iOS)
User takes picture
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?
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.
Related
I created an app for the Wear operating system.
I used Android Studio 3.1.3
In this app I inserted a button and on the click of this I would like the watch to vibrate.
The problem is that the permissions of the app do not work.
I entered the request for vibration permission in the manifest, but when I start the app on the clock does not require me permissions and if I check the permissions registered for the app tells me that no authorization is required.
where am I wrong?
this is my manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ginetto.martinelli.warehousenotification">
<uses-feature android:name="android.hardware.type.watch" />
<uses-permission android:name="android.permission.WAKE_LOCK" android:requiredFeature="true" />
<uses-permission android:name="android.permission.VIBRATE" android:requiredFeature="true"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#android:style/Theme.DeviceDefault">
<uses-library
android:name="com.google.android.wearable"
android:required="true" />
<meta-data
android:name="com.google.android.wearable.standalone"
android:value="true" />
<activity
android:name=".MainActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="#string/default_notification_channel_id"/>
</application>
</manifest>
I created a custom launcher and set it to default launcher for my tablet. but when I open an application and then press Back button I will go to the last launcher(Default launcher of Samsung) although I setup my launcher as default before!
This is my launcher manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="launcher.base.app.ehsan.com.minelauncher">
<!-- To access internet -->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<!-- To auto-complete the email text field in the login form with the JSON's emails -->
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.READ_PROFILE"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<application
android:name=".tools.G"
android:allowBackup="true"
android:icon="#mipmap/logo"
android:label="#string/app_name"
android:supportsRtl="false"
android:theme="#style/AppTheme">
<activity android:name=".activity.MainActivity">
</activity>
<activity
android:name=".activity.LoginActivity"
android:label="#string/title_activity_login"
android:theme="#android:style/Theme.Wallpaper.NoTitleBar.Fullscreen"
android:launchMode="singleTask"
android:stateNotNeeded="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".activity.ForgetActivity"
android:screenOrientation="sensorLandscape"
>
</activity>
<activity
android:name=".activity.RecoveryActivity"
android:screenOrientation="sensorLandscape"
>
</activity>
<service
android:name=".APIService.InternetService"
android:enabled="true"
android:exported="true"/>
</application>
</manifest>
Thank you for Your answers.
My launcher activity not starting can any body tell me whats the problem.
I also have a service in it.
Any help is appreciated Please help i am stuck and don't know what to do.
Here is the code of Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="pelicans.abc.abc">
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-feature android:name="android.hardware.camera" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".Permiss"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity"
android:screenOrientation="portrait">
<meta-data
android:name="android.app.searchable"
android:resource="#xml/searchable">
</meta-data>
</activity>
<service
android:name=".Service.FeatureService"
android:enabled="true">
</service>
<receiver android:name=".Receiver.RestartService"
android:enabled="true"
android:exported="true"
android:label="RestartServiceWhenStopped">
<intent-filter>
<action android:name="Restart_Service"></action>
</intent-filter>
</receiver>
</application>
</manifest>
Launcher activity is not called in any version of android.
Try this :
I think remove this:
<intent-filter>
<action android:name="Restart_Service"></action>
</intent-filter>
//need to modified
<meta-data
android:name="android.app.searchable" //it must contain package name and .searchable
android:resource="#xml/searchable">
</meta-data>
OR
<intent-filter>
<action android:name=".Restart_Service"></action> //add dot
</intent-filter>
really no log?..try more times,try to Log at application onCreate() and activity onCreate()
delete sth,like your MainActivity or RestartService,and try again
If launcher icon is working and launching from studio is not working, then disable Instant Run and try.
We have published an iOS version of our app successfully, but Android is failing. We have deployed it into the Google Play store, but there we get the message that it is compatible with 0 Android devices (which is not a good thing obviously). The following file is the AndroidManifest.xml file found in the APK after compilation on PhonegapBuild (so this is the APK we send to the Google Play store).
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" android:windowSoftInputMode="adjustPan" package="com.myapp.mobileapp" platformBuildVersionCode="22" platformBuildVersionName="5.1.1-1819727">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.RECORD_VIDEO"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera"/>
<uses-feature android:name="android.hardware.camera.autofocus"/>
<uses-feature android:name="android.hardware.camera.setParameters"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<permission android:name="com.myapp.mobileapp.permission.C2D_MESSAGE" android:protectionLevel="signature"/>
<uses-permission android:name="com.myapp.mobileapp.permission.C2D_MESSAGE"/>
<application android:hardwareAccelerated="true" android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:configChanges="locale|keyboard|keyboardHidden|orientation|screenSize" android:label="#string/app_name" android:name="com.myapp.mobileapp.myapp" android:screenOrientation="portrait" android:windowSoftInputMode="adjustUnspecified|stateUnspecified">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<data android:scheme="myapp"/>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>
</activity>
<activity android:label="#string/app_name" android:name="com.keith.canvascameraplugin.CanvasCameraView" android:theme="#android:style/Theme.Black.NoTitleBar"/>
<receiver android:enabled="true" android:name="com.google.android.gms.analytics.AnalyticsReceiver">
<intent-filter>
<action android:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH"/>
</intent-filter>
</receiver>
<service android:enabled="true" android:exported="false" android:name="com.google.android.gms.analytics.AnalyticsService"/>
<receiver android:exported="true" android:name="com.google.android.gms.analytics.CampaignTrackingReceiver">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER"/>
</intent-filter>
</receiver>
<service android:name="com.google.android.gms.analytics.CampaignTrackingService"/>
<activity android:exported="true" android:name="com.adobe.phonegap.push.PushHandlerActivity"/>
<receiver android:exported="true" android:name="com.google.android.gms.gcm.GcmReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
<category android:name="com.myapp.mobileapp"/>
</intent-filter>
</receiver>
<service android:exported="false" android:name="com.adobe.phonegap.push.GCMIntentService">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
</intent-filter>
</service>
<service android:exported="false" android:name="com.adobe.phonegap.push.PushInstanceIDListenerService">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
<service android:exported="false" android:name="com.adobe.phonegap.push.RegistrationIntentService"/>
<meta-data android:name="com.facebook.scom.ApplicationId" android:value="#string/fb_app_id"/>
<meta-data android:name="com.facebook.scom.ApplicationName" android:value="#string/fb_app_name"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize" android:label="#string/fb_app_name" android:name="com.facebook.FacebookActivity" android:theme="#android:style/Theme.Translucent.NoTitleBar"/>
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version"/>
<provider android:authorities="com.myapp.mobileapp.google_measurement_service" android:exported="false" android:name="com.google.android.gms.measurement.AppMeasurementContentProvider"/>
<receiver android:enabled="true" android:name="com.google.android.gms.measurement.AppMeasurementReceiver">
<intent-filter>
<action android:name="com.google.android.gms.measurement.UPLOAD"/>
</intent-filter>
</receiver>
<service android:enabled="true" android:exported="false" android:name="com.google.android.gms.measurement.AppMeasurementService"/>
</application>
</manifest>
The funny thing is that a local build of the app works on my Android device, but it does not work after sending it to PhonegapBuild and then send it to Google Play store. Also worth mentioning is the fact that I can run it on my device from PhonegapBuild, but not from the Google Play store.
Some other facts: the app is build using Ionic (and PhonegapBuild).
What am I doing wrong here?
I have a simple app created with the Titanium classic template. To launch the app by clicking a link on a web page I followed the instructions at https://developer.chrome.com/multidevice/android/intents.
AndroidManifest.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.edtuit.myapp" android:versionCode="1" android:versionName="1.0">
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19"/>
<application android:icon="#drawable/appicon" android:label="myapp" android:name="MyappApplication" android:debuggable="false" android:theme="#style/Theme.AppCompat">
<activity android:name=".MyappActivity" android:label="#string/app_name" android:theme="#style/Theme.Titanium" android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="myapp" android:host="location" android:path="/"/>
</intent-filter>
</activity>
<activity android:name="org.appcelerator.titanium.TiActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="org.appcelerator.titanium.TiTranslucentActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="#style/Theme.AppCompat.Translucent"/>
<activity android:name="ti.modules.titanium.ui.android.TiPreferencesActivity" android:configChanges="screenSize"/>
<service android:name="com.appcelerator.analytics.APSAnalyticsService" android:exported="false"/>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"/>
On a web page I have
Try this
Expected result
When I click the link in the browser on the device I expect it to launch the app "myapp", since it's installed.
Actual result
Google Play is launched searching for "my app" (which correctly fails since the app isn't).
What am I doing wrong here?
It should be intent://location/#Intent (note the '/' before #Intent).