The Android Developer Challenge is back! Submit your idea before December 2.

Run embedded DEX code directly from APK

On devices running Android 10 (API level 29) and higher you can tell the platform to run embedded DEX code directly from your app’s APK file. This option can help prevent an attack if an attacker ever managed to tamper with the locally compiled code on the device.

To enable this feature, set the value of the android:useEmbeddedDex attribute to true in the<application> element of your app’s manifest file. You must also build an APK that contains uncompressed DEX code that ART can access directly. Add the following options to your Gradle or Bazel configuration file to build an APK with uncompressed DEX code:

Gradle

aaptOptions {
   noCompress 'dex'
}

Bazel

android_binary(
   ...
   nocompress_extensions = [“.dex”],
)