kivy / kivy/python-for-android

[Feature]: auto-discover Java sources bundled in pip installed packages

Open
#3,362 12 comments 2 reactions 0 assignees View on GitHub
feature-request
Dominant language
Python
Stars
8.9k
Forks
2k
Avg merge
12h 20m
Merged PRs (30d)
9

Description

If a pip-installable package ships Java source files alongside its Python code, p4a has no way to pick those up automatically. The only supported path is Buildozer's `android.add_src`, which requires the app developer to add files manually.

### Proposed solution

Right after the pip install stage in `build.py` scan the newly installed top level package directories for a fixed marker folder: `android_java/` (for example). If a package contains one, register its path and send to gradle.

Optionally also delete that folder as it's not required/used.

Original idea by @kuzeyron.

CC: @AndreMiras

Contributor guide

Open the contributing guide

Research direction

Start in build.py immediately after the pip install stage and trace how source paths are registered and passed to Gradle. Implement discovery of top-level package android_java/ marker folders, then verify that discovered paths are registered for the Gradle build and consider the proposed folder cleanup.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java, python
Domain
build-system, mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
56/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.