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开发者_Python百科 newbie. Any help would be greatly appreciated.
Thanks in Advance, Navin
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.
精彩评论