IOS Support for Kivy

Kivy has now added official support for IOS platform. You can now package your Kivy application for the Ipad (and other iOS devices, testers needed).

The current instructions are available here: http://kivy.org/docs/guide/packaging-ios.html

For the full story on the multiple Apple limitations we are working with, i want to share the hardest part for Python integration: Apple’s prohibition on using dlopen() to load dynamic libraries.
In a typical case, a compiled Python library’s extension is a “.so”, and the “.so” is dlopen() at import.

That being said, as we did for the python-for-android project published in January, we are redirecting the compilation object to create static libraries. Theses libraries are included in the final application binary. But it’s not enough: we must also tell to Python to look for the library entry point in the application binary, instead of dlopen(). So in the python dynload loader:

return (dl_funcptr) dlsym(RTLD_MAIN_ONLY, funcname)

This way, Python will always look at the application binary, and never need to use dlopen().

If you are worried that Apple would reject a Python-based application, or even using Kivy altogether, we have tested it for you: the game that won the Kivy contest has been packaged for IOS, submitted to Apple… and accepted. You can found Deflectouch on iTunes (source code).

Anyway, Kivy is now officially supporting 5 platforms: Windows, Linux, MacOSX, Android and IOS!

Enjoy 🙂