Skip to content

Commit

Permalink
Android build tool update (#1160)
Browse files Browse the repository at this point in the history
* Update to latest Android build tools

ALooper_pollAll is deprecated

* Update to latest Android build tools

ALooper_pollAll is deprecated

* Update to latest Android build tools

Update manifests

* Update to latest Android build tools

ALooper_pollAll is deprecated

* Update build instructions for Android
  • Loading branch information
SaschaWillems authored Oct 11, 2024
1 parent 380ac44 commit a734964
Show file tree
Hide file tree
Showing 100 changed files with 302 additions and 289 deletions.
8 changes: 4 additions & 4 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ Use the provided CMakeLists.txt with [CMake](https://cmake.org) to generate a bu

### <img src="./images/androidlogo.png" alt="" height="32px"> [Android](android/)

Building on Android is done using the [Gradle Build Tool](https://gradle.org/):
Building on Android is done using the [Gradle Build Tool](https://gradle.org/).

If you want to build it through command line, set Android SDK/NDK by environment variable `ANDROID_SDK_ROOT`/`ANDROID_NDK_HOME`.
**The recommended way** is building via [Android Studio](https://developer.android.com/studio). Simply open the project folder ```android```, build and after that you can select the sample you want to run from the project list.

If you want to build it via the command line, set Android SDK/NDK by environment variable `ANDROID_SDK_ROOT`/`ANDROID_NDK_HOME`.

On Linux execute:

Expand All @@ -48,8 +50,6 @@ On Windows execute ```gradlew.bat assembleDebug```.

If you want to build and install on a connected device or emulator image, run ```gradle installDebug``` instead.

If you want to build it through [Android Studio](https://developer.android.com/studio), open project folder ```android``` in Android Studio.

### <img src="./images/applelogo.png" alt="" height="32px"> macOS and iOS

**Note:** Running these examples on macOS and iOS requires [**MoltenVK**](https://github.com/KhronosGroup/MoltenVK) and a device that supports the *Metal* api.
Expand Down
16 changes: 14 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.0'
classpath 'com.android.tools.build:gradle:8.7.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand All @@ -23,11 +23,23 @@ allprojects {
google()
mavenCentral()
}
// This code is where all the magic happens and fixes the error.
subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
namespace "de.saschawillems." + project.group
}
}
}
}
}
}

ext {
abiFilters = "arm64-v8a"
minSdkVersion = 19
minSdkVersion = 21
targetSdkVersion = 26
compileSdkVersion = 26
shaderPath = '../../../shaders/'
Expand Down
6 changes: 3 additions & 3 deletions android/examples/_template/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.saschawillems.%PACKAGE_NAME%">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:label="%APP_LABEL%"
android:icon="@drawable/icon"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:name="de.saschawillems.vulkanSample.VulkanActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden">
android:configChanges="orientation|keyboardHidden"
android:exported="true">
<meta-data android:name="android.app.lib_name"
android:value="native-lib" />
<intent-filter>
Expand Down
6 changes: 3 additions & 3 deletions android/examples/bloom/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.saschawillems.vulkanBloom">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:label="Vulkan bloom effect"
android:icon="@drawable/icon"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:name="de.saschawillems.vulkanSample.VulkanActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden">
android:configChanges="orientation|keyboardHidden"
android:exported="true">
<meta-data android:name="android.app.lib_name"
android:value="native-lib" />
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.saschawillems.vulkanBufferDeviceAddress">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:label="Vulkan buffer device address"
Expand Down
6 changes: 3 additions & 3 deletions android/examples/computecloth/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.saschawillems.vulkanComputecloth">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:label="Vulkan compute cloth simulation"
android:icon="@drawable/icon"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:name="de.saschawillems.vulkanSample.VulkanActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden">
android:configChanges="orientation|keyboardHidden"
android:exported="true">
<meta-data android:name="android.app.lib_name"
android:value="native-lib" />
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.saschawillems.vulkanComputecullandlod">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:label="Vulkan compute shader cull and LOD"
android:icon="@drawable/icon"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:name="de.saschawillems.vulkanSample.VulkanActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden">
android:configChanges="orientation|keyboardHidden"
android:exported="true">
<meta-data android:name="android.app.lib_name"
android:value="native-lib" />
<intent-filter>
Expand Down
6 changes: 3 additions & 3 deletions android/examples/computeheadless/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.saschawillems.vulkanComputeheadless">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Expand All @@ -10,7 +9,8 @@
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:name="de.saschawillems.vulkanSample.VulkanActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden">
android:configChanges="orientation|keyboardHidden"
android:exported="true">
<meta-data android:name="android.app.lib_name"
android:value="native-lib" />
<intent-filter>
Expand Down
6 changes: 3 additions & 3 deletions android/examples/computenbody/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.saschawillems.vulkanComputenbody">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:label="Vulkan compute N-Body simulation"
android:icon="@drawable/icon"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:name="de.saschawillems.vulkanSample.VulkanActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden">
android:configChanges="orientation|keyboardHidden"
android:exported="true">
<meta-data android:name="android.app.lib_name"
android:value="native-lib" />
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.saschawillems.vulkanComputeparticles">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:label="Vulkan compute particle system"
android:icon="@drawable/icon"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:name="de.saschawillems.vulkanSample.VulkanActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden">
android:configChanges="orientation|keyboardHidden"
android:exported="true">
<meta-data android:name="android.app.lib_name"
android:value="native-lib" />
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.saschawillems.vulkanComputeRaytracing">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:label="Vulkan compute raytracing"
android:icon="@drawable/icon"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:name="de.saschawillems.vulkanSample.VulkanActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden">
android:configChanges="orientation|keyboardHidden"
android:exported="true">
<meta-data android:name="android.app.lib_name"
android:value="native-lib" />
<intent-filter>
Expand Down
6 changes: 3 additions & 3 deletions android/examples/computeshader/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.saschawillems.vulkanComputeshader">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:label="Vulkan compute shaders"
android:icon="@drawable/icon"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:name="de.saschawillems.vulkanSample.VulkanActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden">
android:configChanges="orientation|keyboardHidden"
android:exported="true">
<meta-data android:name="android.app.lib_name"
android:value="native-lib" />
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.saschawillems.vulkanConditionalrender">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:label="Vulkan conditional render"
android:icon="@drawable/icon"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:name="de.saschawillems.vulkanSample.VulkanActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden">
android:configChanges="orientation|keyboardHidden"
android:exported="true">
<meta-data android:name="android.app.lib_name"
android:value="native-lib" />
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.saschawillems.vulkanConservativeraster">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:label="Vulkan conservative rasterization"
android:icon="@drawable/icon"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:name="de.saschawillems.vulkanSample.VulkanActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden">
android:configChanges="orientation|keyboardHidden"
android:exported="true">
<meta-data android:name="android.app.lib_name"
android:value="native-lib" />
<intent-filter>
Expand Down
6 changes: 3 additions & 3 deletions android/examples/debugprintf/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.saschawillems.vulkanDebugprintf">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:label="Vulkan debug printf"
android:icon="@drawable/icon"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:name="de.saschawillems.vulkanSample.VulkanActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden">
android:configChanges="orientation|keyboardHidden"
android:exported="true">
<meta-data android:name="android.app.lib_name"
android:value="native-lib" />
<intent-filter>
Expand Down
6 changes: 3 additions & 3 deletions android/examples/debugutils/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.saschawillems.vulkanDebugutils">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:label="Vulkan debug utils"
android:icon="@drawable/icon"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:name="de.saschawillems.vulkanSample.VulkanActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden">
android:configChanges="orientation|keyboardHidden"
android:exported="true">
<meta-data android:name="android.app.lib_name"
android:value="native-lib" />
<intent-filter>
Expand Down
6 changes: 3 additions & 3 deletions android/examples/deferred/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.saschawillems.vulkanDeferred">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:label="Vulkan deferred renderer"
android:icon="@drawable/icon"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:name="de.saschawillems.vulkanSample.VulkanActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden">
android:configChanges="orientation|keyboardHidden"
android:exported="true">
<meta-data android:name="android.app.lib_name"
android:value="native-lib" />
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.saschawillems.vulkanDeferredmultisampling">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:label="Vulkan deferred multi sampling"
android:icon="@drawable/icon"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:name="de.saschawillems.vulkanSample.VulkanActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden">
android:configChanges="orientation|keyboardHidden"
android:exported="true">
<meta-data android:name="android.app.lib_name"
android:value="native-lib" />
<intent-filter>
Expand Down
6 changes: 3 additions & 3 deletions android/examples/deferredshadows/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.saschawillems.vulkanDeferredshadows">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:label="Vulkan deferred shadow mapping"
android:icon="@drawable/icon"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:name="de.saschawillems.vulkanSample.VulkanActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden">
android:configChanges="orientation|keyboardHidden"
android:exported="true">
<meta-data android:name="android.app.lib_name"
android:value="native-lib" />
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.saschawillems.vulkanDescriptorbuffer">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:label="Vulkan descriptor buffer"
android:icon="@drawable/icon"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:name="de.saschawillems.vulkanSample.VulkanActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden">
android:configChanges="orientation|keyboardHidden"
android:exported="true">
<meta-data android:name="android.app.lib_name"
android:value="native-lib" />
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.saschawillems.vulkanDescriptorindexing">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:label="Vulkan descriptor indexing"
android:icon="@drawable/icon"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:name="de.saschawillems.vulkanSample.VulkanActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden">
android:configChanges="orientation|keyboardHidden"
android:exported="true">
<meta-data android:name="android.app.lib_name"
android:value="native-lib" />
<intent-filter>
Expand Down
Loading

0 comments on commit a734964

Please sign in to comment.