title: How do I check the android version for my app to set an alternative directory?
body: <p>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:</p>
  <pre><code>```val bool = sharedPref.getBoolean(&quot;dwaBool&quot;,false)
  
      val oldPath = if (bool){
          Constants.STATUS_LOCATION_DW
      }else{
          Constants.STATUS_LOCATION
      }
  </code></pre>
  <p>the right directory for android 11 is in a &quot;const val&quot; called &quot;STATUS_LOCATION_AVERS&quot;</p>