For Detailed Breakdown see, Documentation
TL;DR
-
A simple C Extension to return a string
-
Import C Extension in Kivy / Python
-
Create a simple Recipe for Compiled Component for Buildozer / P4A
-
Edit Buildozer :
#In Requirements make sure to mention the C Extension Module
requirements = python3,kivy,custom_lib
#Specify the path for the setup.py / setup.cfg for local C Extension Module
requirements.source.custom_lib = ./custom_lib/
#Specify the path for Recipe for local C Extension Module
p4a.local_recipes = ./python-for-android/recipe
are the main ones to edit based on the paths in buildozer.spec
-
Build with
buildozer android debug deploy run logcat
Note : I've used custom ndk, sdk paths in spec file