title: Base64 support for different API levels
body: <p>In my Android app</p>
  
  <p><strong>build.gradle</strong></p>
  
  <pre><code>android {
      compileSdkVersion 27
      defaultConfig {
          minSdkVersion 16
          targetSdkVersion 27
          ...
          }
      ....
  }
  </code></pre>
  
  <p><strong>Kotlin code</strong></p>
  
  <pre><code>val data = if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.O) {
      Base64.getDecoder().decode(str)
  } else {
      Base64.decode(str, Base64.DEFAULT) // Unresolved reference: decode
  }
  </code></pre>
  
  <p>Obviously, I got compilation error, when using Base64 variant prior to API 24.</p>
  
  <p>But how can I support all the API levels and use Base64 as before 24, as after?</p>