I want to do some stuff in my own android application where I need to check some system applications versions before. (System & 3rd party apps)
How to do it in Android Studio?
In ADB I can dump it by:
adb shell dumpsys package com.samsung.android.calendar | grep versionName
but how to do it in code?
note: it's not duplicated question, none of solutions provided in comments works for me. I want to check ANY app version, not MY app