Skip to content

Android+Vulkan example#9266

Open
SahilM9098 wants to merge 2 commits intoocornut:masterfrom
SahilM9098:feature/android-vulkan-example
Open

Android+Vulkan example#9266
SahilM9098 wants to merge 2 commits intoocornut:masterfrom
SahilM9098:feature/android-vulkan-example

Conversation

@SahilM9098
Copy link

Version/Branch of Dear ImGui:
Version: 1.92.6
Branch: master

Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_android.cpp + imgui_impl_vulkan.cpp
Operating System: Android (NativeActivity)

My Issue/Question:
I am submitting a new standalone example application for Android using Vulkan (example_android_vulkan).

Key features of this example:

  • Built on NativeActivity directly (clean C++ entry point without needing a heavy GameActivity Java wrapper for the main loop).
  • Includes robust Vulkan initialization via vulkan_helper.h (Instance, Device, Queue, Swapchain).
  • Correctly handles Android lifecycle events (APP_CMD_INIT_WINDOW, APP_CMD_TERM_WINDOW) and elegantly rebuilds the Vulkan swapchain on orientation changes via APP_CMD_CONFIG_CHANGED.
  • Maps ImGui_ImplAndroid_HandleInputEvent for touch support.
  • Includes a minimal MainActivity.java subclass to provide Soft Keyboard and Native Android ClipboardManager support via JNI, properly hooked back into ImGui's IO text buffers.

I have included a detailed README.md within the folder to help developers build and run the example using Gradle (./gradlew assembleDebug or ./gradlew installDebug).

Copy link

@abdunosir0809 abdunosir0809 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@@ -0,0 +1 @@
/build No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DDoS Attack

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@@ -0,0 +1 @@
/build No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@ocornut
Copy link
Owner

ocornut commented Mar 11, 2026

Hello Sahil,
Thanks for your PR.

There are however too many changes here to be realistically something I can accept as is.

Android + Vulkan sits at a confluence of two technology that are difficult for me to maintain, so every changes to them needs to be made very carefully, be well understood and documented.

Any Android specific code/data would needs to carefully mimics what is already in example_android_opengl3/, so if changes are desired, they need to be argued and be in sync between both versions.

Any Vulkan specific code needs to carefully mimics what is already in the other example_xxxx_vulkan/ applications.

The aim is to get the closest possible to a situation where I can diff example_android_opengl3 vs example_android_vulkan then diff e.g. example_sdl3_vulkan vs example_android_vulkan, and for both I should see a minimum of changes and almost only change related to the tech differences.

@ocornut ocornut changed the title Feature/android vulkan example Android+Vulkan example Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants