Can't get android intent to work as desired - android

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).

Related

Error loading page Domain:undefined Error Code: -1 Description:net::ERR_FILE_NOT_FOUND

I am still generating this error for an expo start command and to view a page with a leaflet map - -works fine on IoS and my colleagues.
The error is also in console log as follows:
Encountered an error loading page, Object {
"canGoBack": false,
"canGoForward": false,
"code": -1,
"description": "net::ERR_FILE_NOT_FOUND",
"loading": false,
"target": 19,
"title": "",
"url": "file:///android_asset/leaflet.html",
}
at http://10.4.208.108:19000/index.bundle?platform=android&dev=true&hot=false&strict=false&minify=false:170103:20 in onLoadingError
I have added the following potential correction:
https://github.com/react-native-webview/react-native-webview/issues/1050
but, for some reason my expo start keeps failing. I am using a Red Hat distro and thought it might be my system -- so ran in root and still have errors.
Any suggestions deeply appreciated, thanks
Karen
I have tried adding the following to my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.sjaws">
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<queries>
<intent>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="https"/>
</intent>
</queries>
<application android:name=".MainApplication" android:label="#string/app_name" android:icon="#mipmap/ic_launcher" android:roundIcon="#mipmap/ic_launcher_round" android:allowBackup="true" android:theme="#style/AppTheme" android:usesCleartextTraffic="true">
<meta-data android:name="expo.modules.updates.ENABLED" android:value="true"/>
<meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="44.0.0"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://exp.host/#prince_ubs/SJAWS"/>
<activity android:name=".MainActivity" android:label="#string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="#style/Theme.App.SplashScreen" android:screenOrientation="portrait">
<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="com.sjaws"/>
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
</application>
</manifest>

Android Wear Authorization not Working

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>

Why Custom Launcher doesn't work properly sometimes?

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.

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:
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.

Android Manifest not accepting changes

I'm writing a app in android studio 0.8.14(latest) and I am trying to add
<uses-permission android:name="android.permission.GET_TASKS"/>
After adding the permission I clean, rebuild and make the project but I still get error:
E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.SecurityException: Permission Denial: getTasks() from pid=6608, uid=10061 requires android.permission.GET_TASKS
Another peculiar thing is if I remove any of my current permissions(like "android.permission.WR") the app still runs fine like I didn't change a thing
Another permission that isn't working is REORDER_TASKS, but I think it will be fixed once the manifest applies permissions.
This permission doesn't require any special permission as per: https://android.googlesource.com/platform/frameworks/base/+/master/core/res/AndroidManifest.xml
Below is my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="*package*" >
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme2">
<uses-permission android:name="android.permission.GET_TASKS"/>
<uses-permission android:name="android.permission.REORDER_TASKS"/>
<uses-permission android:name="android.permission.WR" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<activity
android:name=".Activity_main"
android:label="#string/app_name"
android:launchMode="singleInstance"
android:screenOrientation="sensorLandscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
Thanks.
Put your uses-permission tag outside application tag
From Documentation:
CONTAINED IN:
<manifest>
Like this.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="*package*" >
<!-- put it here -->
<uses-permission android:name="android.permission.GET_TASKS"/>
<uses-permission android:name="android.permission.REORDER_TASKS"/>
<uses-permission android:name="android.permission.WR" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme2">
<activity
android:name=".Activity_main"
android:label="#string/app_name"
android:launchMode="singleInstance"
android:screenOrientation="sensorLandscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>

Categories

Resources