Open App from android browser if it exists on device - android

scenario:
i get an sms with link like this https://www.xyz.com. once i click on the link it opens a browser and if the app exists on my device [given it has the above link in its data scheme] like below
</intent-filter>
<intent-filter android:priority="100">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="www.xyx.com" />
</intent-filter>
when ever the browser opens the https://www.xyz.com the app is opened.
problem:
this works perfect in emulator. i believe it does in nexus devices too.
but, i tried on htc one x and samsung s3 ... it didnt work.
even the app is present the browser opens the webpage.
is it something the manufacturer done to the OS. theoretically it works in emulators.
now i am worried to publish the app since. most of the devices out there are samsung's htc's etc..,
should i use mime return from that page type now?
is there something i am missing?

Related

Android deep link intent doesn't work on some devices

I have an app that listens for a deeplinks starting with example:// The app can be launched by scanning a QR code containing a deeplink.
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "example://” -->
<data android:scheme="example"/>
</intent-filter>
I am using the code above. It works exactly as expected on Samsung hardware. My other test device is a Google Pixel 5a. When using the google default camera with my app installed, The camera sees a deeplink starting with example:// my app is not part of the "open with" list that appears.
Any ideas what may be causing this?
It looks as though this is a bug specific to the Pixel camera app. The app is treating all example:// links as though the destination is a web browser, even though http:// or https:// is not included

Deep link not working for captive portal

REPOST
So im still having problem with android captive portal/chrome with authpuppy.
Once im connected to a wifi, the captive portal will will pop up, showing a custom page and when user clicks on a button on the page, my app will open.
no matter what i did, on clicking the button, the captive portal will show ERR_UNKNOWN_URL_SCHEME as error. Chrome will show ERR_CONNECTION_REFUSED as error.
I had no problem with firefox or normal web browser.
If successfully authenticate, all the above works like charm, but if pending authentication (no internet) then it will not work.
Android as follows:
<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="http"
android:host="www.mydomain.com"
android:pathPattern="/a/b/c/" />
<data
android:scheme="myapp"
android:host="www.mydomain.com"
android:pathPattern="/a/b/c/" />
</intent-filter>
And html as follows:
<a href="intent://www.mydomain.com/a/b/c/#Intent;scheme=myapp;package=com.mypackage;S.browser_fallback_url=http://play.google.com/store/apps/details?id=blablabla&hl=en;end;";></a>
Can someone pls help me out?
For Android on Chrome / WebView, you should use an Intent per Google Chrome Documentation
https://developer.chrome.com/multidevice/android/intents
Example
intent://#Intent;scheme=abcd://;package=com.abcd.yourapp;S.browser_fallback_url=http://m.abcd.com

Android deep-links (intents): different behaviour between devices

this whole subject took some precious time from my life, and still isn't 100% solved, hope i could find some answers here.
EXPECTED RESULT: when tapping a link to my app (http://www.myapp.com), if app is installed, os should open a dialog where user chooses the app to open this link (my app or browser), if app isn't installed should normally browse this url with the browser.
ACTUAL RESULT:
on Samsung devices, tapping the link (http://www.myapp.com) gives the expected result, a dialog opens prompting me to choose an app to open this with, including my app.
on Nexus devices, on the other hand, it acts like the app isn't installed, and it just browses the url with the browser with no prompting to choose an app to open.
How to get Nexus devices to support this flow as well? like Samsung devices?
this is how i registered the activity in my app manifest:
<activity
android:name=".activities.MainActivity2"
android:configChanges="keyboardHidden|screenSize"
android:theme="#style/application_theme_header_green">
<intent-filter >
<data android:scheme="http" android:host="www.myapp.com" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
hope i provided all needed info.
thanks all.
Try replacing
<data android:scheme="http" android:host="www.myapp.com" />
With
<data android:scheme="http" />
<data android:host="www.myapp.com" />
This looks like the only difference between what I have and what you've posted, and it works on Nexus devices.

What is the intent that the stock Samsung Galaxy S2 gallery app fires when "Send" is clicked?

I currently have the following problem:
I want to receive images with my app that are sent from other apps. So I have registered the following intent-filters:
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
It worked fine for my gallery app (CM9) and a bunch of third party gallery apps i have installed via Play Store (Quick Pic etc...).
But then the client complained that his gallery app (stock Galaxy S2) doesn't show my app in the list when clicks the "Send" button. Interesting side-note: There is also a "Send via" button, which shows up the apps normally (and thus seems to be the SEND_MULTIPLE intent).
The "Send" button shows the following apps:
Bluetooth
Email
Google Mail
Messaging
Wi-Fi Direcct
That's it.
So my question is: Which Intent could this possible be that I have to register for? Can't find any intent for sending files/multiple files other then SEND and SEND_MUTLIPLE :(
Any ideas?
on the Galaxy S2 the ShareIntent appears if the user press menu. That 'Share to' menu on the screen is hard coded by Samsung and you can't override it.

Android Intent filter not working for all devices (action SEND and SEND_MULTIPLE)

I have an android containing an activity that can receive pictures sent to it by the android share menu. The activity has this configuration in the manifest file:
<intent-filter>
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SEND_MULTIPLE" />
<data android:mimeType="image/*" />
</intent-filter>
I am using the mimeType filter to allow only images to be sent to the activity.
Apparently, this is not working on all devices. I have tested it on the Nexus S and Galaxy S/S2 and it worked great, but I've got complaints from some users (especially xperia) saying the app it not showing in the Share menu when it's opened on a photo from the gallery.
The app is using SDK 2.1 sdk 7.
There is no rule that says that an activity have a "share" menu that supports any particular Intent filter.
That being said, I would add:
<category android:name="android.intent.category.DEFAULT" />
to your filter.

Categories

Resources