Android open app from url

Opening android app from url

please don’t answer by only reading the title of the question..That’s not my question..I gave that title only because i couldn’t find any other good title for this question.

I’ve a doubt..Can somebody help me? it’s related to opening a specific app from a url. The procedure is explained here

But that’s not what I want to know. Is there any way that I can hard code that referral url inside the app?

OR may be this will help u to understand.

imagine, user installed an app from google play by clicking a google play referral link..google play sends the content of referral link as an intent and the broadcast receiver captures it and when the user opens the app for the first time, the referral link will be send back to google analytics for tracking the referral.

The tracking works only when the user opens the app for the first time after installation. But i want to track it forever..

So what i’m asking is, can i hard code the above said referral link within the app so that whenever the user opens the app manually, the app sends the referral data again(not to google play, but to a server or site that i’ve already coded in the app?

Please note that i mentioned google play referral only because you can understand my question..

i think this will be more easy to unerstand

case 1: user clicks a url in his browser..browser opens the app. app captures and reports the url

I want the same sequence of things to happen in the following case, except that the user didnt open the app by clicking url, but manually open the app

case 2: user clicks the app’s icon in the device..app opens. app reports the url-here is where my question lies-can i hard code the url? (like a browser launched the app)

and the second case should happen every time the user opens the app, manually. that’s why i asked if there is a way to hard code the url. .

I think this should explain what I’m looking for

A user opens the app manually (by clicking the app’s icon in his device) but the app thinks that the user clicked a specific url (say, www.123.com/abcd-abcd ) and that’s what opened it.

So any way to achieve this?

I will tell you the use of it.. There may be other better and easy options for achieving this like google play referral tracking or MAT etc..But since this got into my mind, i’m looking for an answer

Imagine, i have an app and i’ve 3 friends who’s willing to share my app. I will create 3 different apk(of the same app) and in the first apk, i will include his website’s url(even a fake url will do)..so when the user opens the app manually, it will report to me that it is opened by friend’s url and i can identify that he’s the sharer..

Then i will give the 2nd apk to my second friend with his url inside and app will report this url to me every time a user opens the app..

Then third apk to 3rd friend with his url and app will report his url to me..

So from looking at the total number of url openings(in fact the user didnt opened the app by clicking any url), i can understand which friend is more effective in sharing my app and if their referrals are engaging with my app regularly or not..

Example: i get a report that app opened by 1st friend’s url 50 times..

then i get another report that app opened by 2nd friend’s url 100 times

then i get another report that app opened by 3rd friend’s url 500 times

So from the above report, i can understand that my third friend is most successful in referring my app or the people he shared the app with are the ones who’s engaging with my app mostly.

Читайте также:  Офлайн проигрыватель для андроид

. Or think like this.

You have an app and you gave your friend a referral link and he shares the link with his friends..His friends clicked the link and the browser opens the app(because the app was already installed in the device). then your app captures the link and sends it to you..But you want the app to send the link(report) again whenever the same user opens the app manually(by clicking the icon)..so since the user may not click the link again, the app will not send you the link again because it sends only when somebody open the app from a browser..BUT you want the app to report the link every time the old user opens your app(manually). So any way to hard code the url within the app so that it will report the same way as somebody clicking a link?

And imagine that there is a 2nd friend with a different url and a different apk of the same app(hard coded his url inside the app)

Источник

Open my app from URL scheme in Android

I know there are several questions on SO about this, but none of them are helping to resolve my issue.

I want to be able to click a link from an email/text/browser and open my app.

I have the AndroidManifest.xml code:

This appears to follow the documentation here exactly, however, when I use Chrome (or Android Browser) to browse to myscheme://open , my app does not open, and instead I get Google search results for myscheme://open.

Can anyone see what piece of the puzzle I am missing here? How can I get my app to open via URI?

Small update:

After reading this, I have found that navigating Chrome to market://details?id=com.myapp does not open the play store. Instead it returns Google search results — the same as when trying to launch my app directly. Which is confusing. Am I missing a global OS setting to allow deep linking?

2 Answers 2

Chrome does not open apps from manually-entered URI schemes. In fact, a manually-entered link will never launch an external app in Chrome. This is by design — for whatever reason, the Chrome team feels users should always be kept inside the browser after entering an address.

In other apps, it’s up to the app in question whether a custom URI scheme is identified as a ‘clickable link’. For best compatibility, you’ll want to wrap it inside a regular http:// link with a redirect.

If you’re interested in an in-depth explanation of the complications around deep linking, this post is a good place to start. If you just want it to work without a lot of extra effort, Branch.io (full disclosure: I’m on the Branch team) solves this problem as a free service.

There is no requirement for any app to pay any attention to myscheme://open .

There is no requirement for any Web browser to try to launch some third-party app when you type myscheme://open into the address bar, because users are unlikely to do that in the real world.

There is no requirement for an email program to try to create an ACTION_VIEW Intent for myscheme://open .

There is no requirement for an SMS client to search all incoming messages for the string myscheme://open , realize that this is somehow an app link, and do something with it.

You will have somewhat better luck overall using an https (or, in a pinch, http ) URL as your app link (the http://www.example.com/gizmos URL from the documentation that you linked to). Then, SMS clients might recognize that this is a URL and do something with it. And, overall, you should be taken either to your app or to your Web page, both of which are at least somewhat useful to the user. However, your app still will not necessarily open when the user types your URL into the address bar, as browsers may not expect an app link to be entered there.

You can increase the odds of an https app link working, and working the way that you want, by publishing a digital asset links file and tying that into your manifest.

However, overall, this is still reliant on clients opting into paying attention to this stuff. Sometimes they will, because Android makes it relatively easy to do so. Sometimes they will not. A Web browser is welcome to see your URL, see that it is https , say «hey, as a Web browser, I know how to handle this!», and go load that Web page, ignoring your installed app. You and I might consider that to be a bug in that browser; the developers of that browser are welcome to disagree.

I have found that navigating Chrome to market://details?id=com.myapp does not open the play store

This goes back to the «developers can do what they want» part. If you clicked a link in a Web page to that URL, there is a chance that Chrome will take you to the Play Store. However, Chrome is not obligated to treat the address bar the same as it treats a link in a Web page.

Читайте также:  Hisense android tv 4pda

Источник

How to open an installed app from an email URL in Android? [duplicate]

I want to open my app from an email URL, basically like the example shown below for Twitter.com.

Email with link:

Selection to open app or browser:

After you click on the app choice, the Twitter app opens:

I tried the following code, but it is not working:

If anyone has a proper answer, please write some examples here.

3 Answers 3

The following code worked for me:

With the email link set as http://www.my.app.com/launch .

Ex: Your url will be something like https://roadies.com and you have the intent filter in manifest as below

For me, none of the answers posted here worked. I tried tens of different syntaxes without any success. I was getting a parsing error while building the app via Cordova.

I finally encountered this answered which led me on the right track.

So I created a hook in the PROJECT_ROOT/hooks/after_prepare/ folder called 010_add_intent_filters.sh . Here is the content of this hook :

This finally worked. No modification to config.xml is required if you take the hook path. I hope this helps someone in need.

PS: I am convinced Cordova is a great technology, but I have rarely seen such a badly documented library. How painful it is to work with it is just unbelievable.

Источник

Open Android app from URL using intent-filter not working

I have an Android app that people use as a replacement for a website. Hence, when users encounter an URL to the website, I want to give them the option to «open the URL» in my app instead of in the browser. In other words I want the popup to appear that lets them choose between my app and the browser (and possibly other apps).

I understand from various sources that I need to add an intent filter to an activity in my app with the ‘data’ filter that filters on URLs of the correct form.

The website in question is http://members.iracing.com, hence I have added the following intent filter:

I have tried various forms of these data filters, like using a single ‘data’ node with both attributes:

It is simply not working. I don’t know what else to tell you. I hosted a simple HTML page on my website with a couple links to various pages on that website (all starting with «http://members.iracing.com/. «) and when I click any of them, they simply open in the browser without ever asking me which app I want to use. I tried it both on the emulator as well as after installing the app on my physical device, nothing works. I tried this in a completely BLANK, new Android project just to see if that would work, nothing.

I then realized that the website requires authentication, and if you are not logged in it redirects to the login page at https://members.iracing.com/membersite/login.jsp, hence I tried replacing the scheme by «https». I even tried changing the host to «www.members.iracing.com», and in the end I even tried a combination of all these things (not sure if this should work, but hey, I’m desperate at this point. )

Still no go. I’m not sure if the redirect is relevant though, the browser clearly first goes to the non-redirected site, then does the redirect to the login page, but at no point do I get the choice to open it in my app. Furthermore, if I login manually in the browser first, there is no redirect, and it still does not work.

Am I missing something obvious here? I’m pulling my hair out why this isn’t working, and I cannot debug it besides trying every possible combination I could think of (I did. ). Thanks for any help!

Источник

How to Open an Android App from the Browser

Alex Austin

January 8th, 2018

Читайте также:  Kemono musume no sodatekata android

Opening an installed app from a browser is often referred to as “deep linking”, and with this guide you’ll learn how to deep link into your Android app for yourself. We’ll focus exclusively on how to trigger an app open from a website page, rather than from the click of a link inside other apps. For a more detailed look at all of the different deep linking standards required for complete Android coverage, please see our Android deep linking series: Part 1 , Part 2 , Part 3 , and Part 4 .

Android is, by far, one of the most fragmented platforms that developers have ever had to manage, due to Google’s decision to force device manufacturers to be responsible for porting the OS, which requires backwards compatibility and support of a multitude of devices. In this ecosystem, we, the app developers, are left to pick up the pieces. Deep linking on Android is unfortunately no different—over the years, we’ve seen a plethora of technical requirements that must be used depending on the circumstance and context of the user.

Note that Branch will implement all of this complexity for you, host the deep links, and even give you robust analytics behind clicks, app opens, and down funnel events. You can play around with Branch links for free by signing up here . We highly recommend using our tools instead of trying to rebuild them from scratch, since we give them all away for free.

Overview of Changes

There are two places where changes will need to be made in order to successfully open your Android app: your website and your Android app. You can find the details of each change in the corresponding sections below.

Adding Support for URI Schemes to Your App

A URI scheme can be any string without special characters, such as http , pinterest , fb or myapp . Once registered, if you append :// to the end (e.g. pinterest://) and click this link, the Pinterest app will open up. If the Pinterest app is not installed, you’ll see a ‘Page Not Found’ error.

It is simple to configure your app for a URI scheme. To start, you need to pick an Activity within your app that you’d like to open when the URI scheme is triggered, and register an intent filter for it. Add the following code within the tag within your manifest that corresponds to the Activity you want to open.

You can change your_uri_scheme to the URI scheme that you’d like. Ideally, you want this to be unique. If it overlaps with another app’s URI scheme, the user will see an Android chooser when clicking on the link. You see this often when you have multiple browsers installed, as they all register for the http URI.

Next, you’ll want to confirm that your app was opened from the URI scheme. To handle the deep link in the app, you simply need to grab the intent data string in the Activity that was opened via the click. Below is an example:

From here, you’ll need to do string parsing to read the values appended the URI scheme that will be very specific to your use case and implementation.

Adding Javascript to Your Website to Open Your App

Now that your Android app is ready to be triggered from a URI scheme, the next part is simple. You merely need to add some Javascript to your website that will auto trigger your app open. The function below, triggerAppOpen , will attempt to open your app’s URI scheme once you replace your_uri_scheme with the one you added in the manifest above.

You could call triggerAppOpen into window.onload if you wanted to do it on page load, or you could make it the onclick of a link somewhere on your site. Either works and the you’ll get the intended results.

Android is incredibly complicated, and there are edge cases everywhere. You’ll think everything is going well until you get that one user complaining that his links aren’t working on Facebook while running Android 4.4.4. That’s why you should use a tool like Branch—to save you this nightmare and ensure that your links work everywhere. Be sure to request a Branch demo if you’re interested in learning more.

Источник

Оцените статью