For one of my clients they want to redirect customers who are viewing their mobile site from their android to the android market. The url is something like http://market.android.com/search?q=com.company_name , which when clicked on as a link functions correctly but if done as a redirect via php header('location : http://market.android.com/search?q=com.company_name'); will resolve to 404 page not found.
From a pc the link will never resolved, it will only work from an Android phone and only when the link is clicked on via an a href.
Summary
a href='http://market.android.com/search?q=com.company_name' - Works when clicked
header('location: http://market.android.com/search?q=com.company_name'); - Does开发者_运维百科 not work: 404 error
The correct uri for the android market search for a publisher is: market://search?q=pub:com.company_name
Also "Note that these URIs work only when passed as Intent data — you can't currently load the URIs in a web browser, either on a desktop machine or on the device."
more info can be found at http://developer.android.com/guide/publishing/publishing.html at the bottom of the page.
(or for using http: http://market.android.com/search?q=pub:com.company_name )
精彩评论