NavinC
NavinC

Reputation: 243

How to make an Android application use specific version of another application

I have to develop an Android application which should access a specific version of another application installed on the same machine. Is there a way we can handle this check programmatically? I am an Android newbie. Any help would be greatly appreciated.

Thanks in Advance, Navin

Upvotes: 0

Views: 477

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006674

Is there a way we can handle this check programmatically?

Use PackageManager and getPackageInfo() to get a PackageInfo object for the specific application, identified by its package (e.g., com.commonsware.mygreatapp). The versionCode and versionName fields on the PackageInfo will have the information you seek.

Upvotes: 4

Related Questions