Android 13 (SDK 33): PackageManager.getPackageInfo(String, int) deprecated. what is the alternative?

If you are using Kotlin, you can add extension function to your project: fun PackageManager.getPackageInfoCompat(packageName: String, flags: Int = 0): PackageInfo = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { getPackageInfo(packageName, PackageManager.PackageInfoFlags.of(flags.toLong())) } else { @Suppress(“DEPRECATION”) getPackageInfo(packageName, flags) } and after just call packageManager.getPackageInfoCompat(packageName) or add another flag, if you need.

Android SDK 28 – versionCode in PackageInfo has been deprecated

It says what to do on the Java doc (I recommend not using the Kotlin documentation for much; it’s not really maintained well): versionCode This field was deprecated in API level 28. Use getLongVersionCode() instead, which includes both this and the additional versionCodeMajor attribute. The version number of this package, as specified by the tag’s … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)