Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

PackageInfoCompat

class PackageInfoCompat
kotlin.Any
   ↳ androidx.core.content.pm.PackageInfoCompat

Helper for accessing features in PackageInfo.

Summary

Public methods

static Long

Return android.R.attr#versionCode and android.R.attr#versionCodeMajor combined together as a single long value.

Public methods

getLongVersionCode

static fun getLongVersionCode(@NonNull info: PackageInfo): Long

Return android.R.attr#versionCode and android.R.attr#versionCodeMajor combined together as a single long value. The versionCodeMajor is placed in the upper 32 bits on Android P or newer, otherwise these bits are all set to 0.