So I have this code where I want to get some files in a certain app directory, but on android 11, this app directory is not the same as the old versions, how do i modify my code to check this and get all versions right directories:
```val bool = sharedPref.getBoolean("dwaBool",false)
val oldPath = if (bool){
Constants.STATUS_LOCATION_DW
}else{
Constants.STATUS_LOCATION
}
the right directory for android 11 is in a "const val" called "STATUS_LOCATION_AVERS"
2
Answers
you can use this snippet
BuildConfig.VERSION_CODE
gives the current version integer number of the app.