Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request Feature: build cpp code to android #6281

Open
albertxavier100 opened this issue Sep 23, 2024 · 1 comment
Open

Request Feature: build cpp code to android #6281

albertxavier100 opened this issue Sep 23, 2024 · 1 comment
Labels
a:language-c++ C++ API, codegen, CMake build system (mS,mO) a:platform-android Android platform integration (mO,bS) enhancement New feature or request

Comments

@albertxavier100
Copy link

albertxavier100 commented Sep 23, 2024

I'd like to request a feature: build cpp code to android. It can save my life. any related info is welcomed, Im willing to try them

ENV: target os: Andriod, working po: windows 11, language: c++

@ogoffart ogoffart added need triaging Issue that the owner of the area still need to triage a:language-c++ C++ API, codegen, CMake build system (mS,mO) a:platform-android Android platform integration (mO,bS) and removed need triaging Issue that the owner of the area still need to triage labels Sep 23, 2024
@ogoffart
Copy link
Member

I think to make this work we need:

  • In rust, implement the android_main function in the crate in api/cpp/, and call slint::android::init from it, as well as some callback into the C++ application written from the user somehow to call their "main"

  • Get the build system to generate an APK with the user's application C++ application and the rust library

I'm not sure if there are other API that needs to be exposed to C++ (like what would be the argument of this "main" functions being called and how to define it.)

I'm unfortunately not very familiar with the android build system, so i can't really assess how hard the second point is.

@ogoffart ogoffart added the enhancement New feature or request label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:language-c++ C++ API, codegen, CMake build system (mS,mO) a:platform-android Android platform integration (mO,bS) enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants