But it only gets the current API version of the current package.
No, it gets the API level of the operating system that is running on the device.
Is there a way for me to query other packages API versions through other means?
There is no such concept in Android.
Which means i want to know the API version of specific application in my Android System as i am currently using package manager to retrieve the package names
There is no such concept in Android.
Yes, my specific problem is because i have to do certain stuffs for API level < 4 and certain stuffs for API level > 4 above because of the android.WRITE_EXTERNAL_STORAGE permission that i have to detect
You are welcome to "do certain stuffs" within your app based on the device's API level, using code like you have in your question. Every other app is welcome to do its own "certain stuffs" based on the device's API level.