Kodi krypton for android5/27/2023 ![]() ![]() Python in CrystaX NDK uses 4 byte Unicode characters while Python in Kodi is built with 2 byte Unicode characters, so without those strings your binary module may fail to build. ![]() Now open the file pyconfig.h in your favorite code editor and add the following lines to the end of the file: #undef Py_UNICODE_SIZE If you are using Python 2.7 headers from CrystaX NDK I'd recommend to copy all headers to a separate directory. ![]() Go to d:\crystax-ndk-10.3.2\sources\python\2.7\include\python directory (adjust the path to your specific location) and copy all header files that start with pyconfig* to other Python headers. Fortunately, CrystaX NDK has those headers so we can borrow them. However, raw Python sources are missing configuration headers that define interpreter configuration for a specific platform. Put those in the directory on your choice. We need only Include directory that contains necessary C headers. If you choose Python 2.6, download Python sources from GitHub (don't forget to check-out the necessary version) or from Kodi mirrors. (This statement is not true in case of Python 2 vs 3, but for Kodi addons it is not relevant.)ĬrystaX NDK v.10.3.2 already include Python 2.7 headers so you can use those. Just to be clear: Python/C API does not have backward-incompatible changes, so binary modules built against Python 2.6 will work on 2.7 too. Otherwise you will have to use Python 2.6. So the rule is simple: if you are not going to support Kodi versions older than 17 (Krypton), choose Python 2.7. For example, my Acer IconiaTab A510 tablet stull runs Android 4.1 JB so the maximum Kodi version I can use is 14.2 (Helix). So those devices are stuck with older Kodi versions. However there are still many devices in use that have been abandoned by their manufacturers and do not receive OS updates. Unfortunately, newer Kodi versions are released for newer Android versions. 17 all platforms use Python 2.7, including Android. 17 (Krypton) Kodi on Android used Python 2.6 but starting from v. Python headersįirst, we need to decide which Python version we will use to build our binary modules. ![]() In my experiments it's located in d:\crystax-ndk-10.3.2 directory on a Windows machine. Download CrystaX NDK for you platform and unpack it to the directory of your choice. The guys that have developed CrystaX NDK describe it as a drop-in replacement for Google's Android NDK but with better support of C/C standards. CrystaX NDKĪndroid NDK is a set of tools that allow to build binary (native) components for Android apps. In this article I will cover prerequisites needed to build a Python/C extension module for Python in Kodi for Android. This is the 1 st article in my series about building and using binary Python modules in Kodi on Android. Because of this the following series of articles now has only historical value since there is a strong chance that you won't be able to use your compiled binary Python module(s). This means that currently there is no known way to import binary modules in Python addons on such devices. On recent Android 7 firmwares for some devices, including my Samsung Galaxy Tab A 10.1, the magic workaround that allows to load binary Python modules from Kodi addons no longer works. ![]()
0 Comments
Leave a Reply. |