How do I check whether another application is installed?

Hi,
I’m making a new game now and I want to put a particular feature. I want to include a character from my previous game as an unlockable that will only come out if you download the previous game(Not a requirement in the game. Just an optional extra feature).
I need to know the code to check whether another application is installed to make this work.
Please, any ideas ?

Don’t know if this is a valid solution for you, but I saw sometime ago a piece of code around stackoverflow that does exactly this. You can have a look at PackageManager  |  Android Developers if needed and write a plugin for it. Don’t know if it can be done directly from Unity though.

Cheers.

I’m not positive, never tried, but wouldn’t using player prefs to have common variables across games work? I might be wrong, as each game might use unique player prefs…but if not, you could have a bool like HasPlayedMyOtherGame == true;

Someone let me know if this is impossible or not!

@ hexdump … Thanks. I’ll take a deeper look into this and let you both know when I work it out.
@ MD_Reptile … I think every game has it’s unique PlayerPrefs . The last game I made also had a demo version with the same PlayerPrefs but still worked separately on the same device.

Thanks for the response … I may send you direct messages with my solution when I’m done.

Hi smyte100, have you found out how to detect if another app is installed on the device with unity?

You have to use Java code for checking
https://sites.google.com/site/androidhowto/how-to-1/detect-if-an-app-is-installed

AndroidJavaClass up = new AndroidJavaClass(“com.unity3d.player.UnityPlayer”);
AndroidJavaObject ca = up.GetStatic(“currentActivity”);
AndroidJavaObject packageManager = ca.Call(“getPackageManager”);
Debug.Log(" ********LaunchOtherApp ");
AndroidJavaObject launchIntent = null;
//if the app is installed, no errors. Else, doesn’t get past next line
try{
launchIntent = packageManager.Call(“getLaunchIntentForPackage”,bundleID);

}catch(UnityException ex){
Debug.Log(“exception”+ex.Message);
}
if(launchIntent == null)
return false;
return true;

Im sorry to bump this thread. Im searching about to do the same but with windows 10. Is there any way?