0

As part of my current project I've been tasked with collecting URL's for various applications on the official Android Market.

I have a market URL such as:

https://play.google.com/store/apps/details?id=com.endomondo.android.pro

On most devices when I follow a URL such as this I am presented with a pop-up asking if I want to open the link in the browser or with the Market Application.

However on the EVO 4g LTE device when I follow a URL such as this, I receive no prompt and instead it opens immediately in the browser.

Has anyone run across any other devices that do not properly handle market links? And does anyone know if there is some other magical URL I can use that would work properly on this device as well as all of the others? Note: I am not launching an intent here, the user will be clicking on this link outside of my application, so I can't use the market:// uri.

EDIT:

I've found this blurb on the doc page for Publishing on Google Play

Note: If you create a link to open Google Play from your web site and the user selects it from an Android-powered device, the device's Google Play application will resolve the link so the user can use the Google Play application on the device instead of opening the web site. As such, you should always use http://play.google.com/store/apps/... URIs when creating a link on a web page. When pointing to your apps from within your Android app, use the market:// URIs in an intent, so that the Google Play application always opens.

Which seems to indicate that the play app will "intercept" and resolve the link (as it seems to do on every other device).

So this may just be a bug with specific play store apk that is installed on this device.

EDIT 2 :

If I use a market uri the device correctly opens up the play store application. My next hurdle though is I need to be able to get click thru data from these links. The way I was doing it before was shortening them with bit.ly which also tracks the clicks for me. However bit.ly and goo.gl won't let me shorten a market:// uri string. Does anyone happen to know of a URL shortener that has click thru stats, and will allow me to shorten a market:// uri string even though it is not technically a valid URL?

FoamyGuy
  • 46,603
  • 18
  • 125
  • 156
  • Does that device have the updated Google Play app? Or does it still have the old Android Market app? – kabuko Jun 12 '12 at 20:03
  • The new Google Play app is on the device. Sorry I am still trying to convince myself that the name change is a bad dream. – FoamyGuy Jun 12 '12 at 20:09
  • 1
    As you noted, normally a list of activities that can handle the `Intent` comes up. In that dialog, there's a check box that says "Use by default for this action." Have you considered that it might have been previously checked? Go to Settings -> Manage Applications -> Browser -> Clear Defaults and try again. – kabuko Jun 12 '12 at 20:19
  • Good suggestion, I had not tried that before. Just did, but same result, URL still opens in the browser. – FoamyGuy Jun 12 '12 at 20:23

2 Answers2

1

You can try the older 'market://' scheme to see if that works out. Apparently there have beein some patent issue regarding the activity chooser displayed when you click on a link, and on some HTC devices it has been disabled. You might be hitting this. You could try with other URLs that open in native apps (like for Google+, Picasa, Gmail) to check how your device handles them.

Nikolay Elenkov
  • 52,576
  • 10
  • 84
  • 84
  • good point. My understanding of the patent bickering was that it was the act of scanning the text and linkifying it, not the choice the user was presented with. But the more I think about it, the more I think you are right. The market:// uri does work. But I don't know yet if I will be able to use it. I need to get the URLs shortened (or be able to get click stats from them in some other way) and bit.ly / goo.gl won't let me shorten market:// uri. – FoamyGuy Jun 19 '12 at 13:27
  • An alternative is to potentially register your own URL like ``timsmarket:://foo.bar`` and register that to your own application. Then clicking on those links will go through your app which does the auditing and then intents off directly to ``market://foo.bar``. Is [that](http://stackoverflow.com/questions/3471503/how-to-listen-for-a-custom-uri) an option for you? – scorpiodawg Jun 19 '12 at 22:00
  • Good suggestion, but unfortunately it is not. My app will run on devices that are accessible to the public, the idea is that they will be sending the links from my app to their own phone which won't be running my application. – FoamyGuy Jun 20 '12 at 13:06
1

Has anyone run across any other devices that do not properly handle market links?

Many newer HTC models will have this behavior.

And does anyone know if there is some other magical URL I can use that would work properly on this device as well as all of the others?

Use market://. Due to the nature of HTC's change, all http:// URLs will go to whatever the user has established as their preferred activity for such URLs, which will normally be a browser.

Does anyone happen to know of a URL shortener that has click thru stats, and will allow me to shorten a market:// uri string even though it is not technically a valid URL?

Push come to shove, set up your own HTTP URL someplace that can do a redirect for you to your market:// URL, and use that URL. The usability on this stinks, insofar as the user will get a browser, then the Play Store.

My understanding of the patent bickering was that it was the act of scanning the text and linkifying it, not the choice the user was presented with.

HTC's workaround for the patent dispute, unfortunately, can be best described as "swatting a fly with a Buick".

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491