0

when I try and load this URL http://www.shazam.com/music/web/track?id=45759675 My activity load this other http://www.shazam.com instead

This is my android code:

public class SingleMenuItemActivity extends Activity {

    public void onCreate(Bundle savedInstanceState) {

        WebView mWebView;

        super.onCreate(savedInstanceState);
    setContentView(R.layout.single_list_item);
    final ProgressDialog pd = ProgressDialog.show(this, "", getResources()
            .getString(R.string.loading), true);
    mWebView = (WebView) findViewById(R.id.webview);
    mWebView.getSettings().setBuiltInZoomControls(true);
    mWebView.setWebViewClient(new WebViewClient() {
        @Override
        public void onPageFinished(WebView view, String url) {
            if (pd.isShowing() && pd != null) {
                pd.dismiss();
            }
        }
    });
    mWebView.getSettings().setLoadWithOverviewMode(true);
    mWebView.getSettings().setUseWideViewPort(true);
    String weblink = getIntent().getStringExtra("link");

    mWebView.loadUrl(" http://www.shazam.com/music/web/track?id=45759675 ");
}

  }

the same behavior happens with my browser on my smartphone but no when i connect to this URL from my PC. All the browsers are G Chrome. questions:

  1. Why does it happen
  2. how to avoid it and connect to the proper URL
eeadev
  • 3,662
  • 8
  • 47
  • 100

1 Answers1

2

It looks like Shazam.com doesn't allow mobile browers to browse the Music section. Unless you change the user-agent, there is not much you can do. They obviously have their own reason to disallow mobile browsing. If you wish to include shazam content in your application you should contact them first.

Tchoupi
  • 14,560
  • 5
  • 37
  • 71
  • 1
    you can follow this link for a working UA string that can solve this issue : http://stackoverflow.com/questions/8309796/want-to-load-desktop-version-in-my-webview-using-uastring – Mr.Me Mar 17 '13 at 16:44
  • Mathieu, that was just a trial and I dont intend to use their content. Thanks for your help. – eeadev Mar 17 '13 at 16:55