You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Proposal: Android-Specific Metadata Support in Recipes #3179
Introduce support in python-for-android to parse Android-specific metadata from pyproject.toml of pip-installed packages. This enables modular bundling of assets into APK builds, allowing packages to contribute platform-native components directly.
p4A can loop through all installed python packages looking for a android.toml or in the root folder of each package or in root/android. When found it loads toml file and extracts the java src file only and copy it to ctx.javaclass_dir.
The reason I said java src file only is because modifying xml or adding resources can conflict with what the user want's to modify themselves.
where android and java are the directory inside the packages containing the java files in a java compliant package directory. then we can extract them and put in environ just like the way the versions are stored in environ also. and then copy them to ctx.javaclass_dir.
Activity
kengoon commentedon Dec 6, 2025
@kuzeyron I want to take on this, but I don't know if the approach I have in mind is okay. Here's what I'm thinking: directly under this code:
python-for-android/pythonforandroid/build.py
Lines 528 to 531 in 359975b
p4A can loop through all installed python packages looking for a
android.tomlor in the root folder of each package or inroot/android. When found it loads toml file and extracts the java src file only and copy it toctx.javaclass_dir.The reason I said java src file only is because modifying xml or adding resources can conflict with what the user want's to modify themselves.
kengoon commentedon Dec 6, 2025
Something even better,
--requirementsargs can be modified to accept extra arguments. e.gwhere
androidandjavaare the directory inside the packages containing the java files in a java compliant package directory. then we can extract them and put inenvironjust like the way theversionsare stored inenvironalso. and then copy them toctx.javaclass_dir.@kuzeyron what do you think?
kuzeyron commentedon Dec 7, 2025
Sure, why not? Make sure to write a proper documentation of this if you proceed with this task.