Skip to content

Integrating QuickLyric in your app

Guillaume edited this page Apr 28, 2017 · 4 revisions

Integrating QuickLyric in your app

Create a button. If QuickLyric is not installed, clicking the button should prompt the user to install the app. If it is installed, the button should open QuickLyric with the lyrics for the requested song.

Detecting if QuickLyric is installed

public static boolean isQLInstalled() {

    PackageManager pm = getApplicationContext().getPackageManager();
    try {
        pm.getPackageInfo("com.geecko.QuickLyric", PackageManager.GET_ACTIVITIES);
        return true;
    } catch (PackageManager.NameNotFoundException ignored) {
        return false;
    }
}

If it's not installed, prompt the user with a link to install QuickLyric. This link needs to be a Firebase link (or a F-Droid link if that's what you want to do). Please email me and I will give you one.

Opening QuickLyric from your app

Next, simply create an intent:

Action: com.geecko.QuickLyric.getLyrics

Extras:

  • key: "TAGS"
  • value: new String[]{artist, trackname}

And send it.

Basically, all you have to do is use this:

startActivity(new Intent("com.geecko.QuickLyric.getLyrics").putExtra("TAGS", new String[]{"Daft Punk", "Get Lucky"}));

This will open up QuickLyric with the lyrics for the specified song.

If you can, please ensure the tags are properly encoded (i.e. "Madonna" and "Holiday" - not " Unknown Artist " - "Madonna - Holiday").