I am launching a HttpURLConnection from my Android device that points my server i.e. http://example.com/download-app. The server receives this request and issues a redirect to market://details?id=my.package.name. The aim is to have the Android Market app on the phone open and navigate to the app download page.
However, this doesn’t seem to work. I set redirects to true on the HttpURLConnection i.e.
HttpURLConnection.setFollowRedirects(true);
but the URL I receive back is always the same URL to my server i.e. http://example.com/download-app.
If I use a redirect link using the “http” protocol like http://market.android.com/details?id=my.package.name, it works but instead opens up the new web based market NOT the app on the phone.
Has anyone else experienced this?
Then why are you using
HttpUrlConnection?If you want to view a Web page, use an
ACTION_VIEWIntent: