AndroidApk Item

An AndroidApk item is a Product of type android.apk. It has a dependency on the Android.sdk module. The final build result is an Android application package (APK) file. Here is what the project file could look like for the BasicMediaDecoder example that comes with the Android SDK:


  import qbs

  AndroidApk {
      name: "Basic Media Decoder"
      packageName: "com.example.android.basicmediadecoder"

      property string sourcesPrefix: "Application/src/main/"

      resourcesDir: sourcesPrefix + "/res"
      sourcesDir: sourcesPrefix + "/java"
      manifestFile: sourcesPrefix + "/AndroidManifest.xml"
  }

AndroidApk Properties

The following properties are available in addition to the ones inherited from Product.

PropertyTypeDefaultDescription
assetsDirpath"assets"The base directory for Android assets.

Note: Android requires that the file name of this directory is always "assets".

automaticSourcesbooltrueIf this is enabled, Java sources as well as Android resources, assets and the manifest file will be automatically included in the product via wildcards. Set this property to false if you want to specify these files manually.
manifestFilepath"AndroidManifest.xml"The file path to the Android manifest file.

Note: Android requires that the file name is always "AndroidManifest.xml".

packageNamestringnameThe package name as given in the manifest file.
resourcesDirpath"res"The base directory for Android resources.

Note: Android requires that the file name of this directory is always "res".

sourcesDirpath"src"The base directory for Java sources. This property is only relevant if automaticSources is enabled.