0

I am trying to perform a search on Deezer by sending the following intent:

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.deezer.com/search/" + query));
this.startActivity(intent);

In a previous version the web browser opened with a link saying "Open in Deezer" (or the like). But in the current version this doesn't work anymore.

Is there any way to open the Deezer app and perform a search? I have already tried the following (without success):

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("deezer://search/" + query));
this.startActivity(intent);
Yash Sampat
  • 30,051
  • 12
  • 94
  • 120
Markus
  • 1,649
  • 1
  • 22
  • 41

2 Answers2

5

There are many deeplinks you can use to search for content inside the Deezer app. You do have the basic search like this :

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("deezer://www.deezer.com/search/" + query));
this.startActivity(intent);

But you can also be more precise :

// Search for an artist, will display the best match
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("deezer-query://www.deezer.com/artist?query" + query));
this.startActivity(intent);

// Search for an album, will display the best match
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("deezer-query://www.deezer.com/album?query" + query));
this.startActivity(intent);

// Search for a track, will display the best match
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("deezer-query://www.deezer.com/track?query" + query));
this.startActivity(intent);
XGouchet
  • 10,002
  • 10
  • 48
  • 83
2

I believe it should be

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("deezer://www.deezer.com/search/" + query));
this.startActivity(intent);

The scheme of the Uri needs to be deezer. You have set it as http.

Try this. This should work.

Yash Sampat
  • 30,051
  • 12
  • 94
  • 120