Having made its indelible mark on web development, game development, databases, system administration, functional testing, data mining, network development, user interface, computer graphics, visual effects, embedded systems and on many other domains, Python has one more important platform to conquer — Mobile space.
As the web content consumption on mobile devices has overtook that of the desktop, and the increasing computing power and rich apps clothe them, it’s only a matter of time before the mobile devices take over most of, if not all the traffic of Internet. Given the current golden era of mobile computing, Python is yet to join the party — until now. Because there’s something great in the horizon for Python, the potential of which I believe is huge.
It has been possible to write mobile applications in Python for a couple of years; there have been various iOS and Android libraries and apps that allow you to run and write Python on your mobile device. However, the idea of writing mobile applications in Python has never really gone mainstream. This is a major challenge for Python as a language; if Python isn’t able to service this major new platform, it risks obsolescence in favour of languages that can.
Over the last two years, the BeeWare project has been developing tools that allow developers to write mobile applications in Python. The goal of this work is to make it as easy to develop a mobile application as it is to develop web applications or data analysis tools. The process of developing these tools requires some deep diving into the internals of Python and it’s implementations, a lot of dead ends, and (unfortuantely) writing a lot of code in languages other than Python.
Russell Keith-Magee, a core developer of the Django project for over a decade has something special to offer in terms of Python’s entry into the mobile space. His talk at the PyCon 2016 has shed the light of inspiration for all of us in the Python community. Let’s understand his idea of “Mobile Python” and how it can be realized in this post.
While rather technical, Russell’s projects, encompassing the BeeWare project, plan to make python a cross-platform language capable of making native mobile apps for both the iOS and Android app stores. Though the project is in the very early stages, it is an ambitious goal for the Python language and will help to bring it on par with existing frameworks like Java where such cross-platform development is already active. I forked one of Russell’s projects, toga, and had almost no trouble getting it running on Ubuntu. I have plans on testing out the other projects in the BeeWare suite for iOS and Android development. No more Swift. No more Android SDK. I’d love to plan on writing our mobile apps in Python moving forward!
This talk will be an “under the hood”, deep technical dive into the tools and techniques that are needed to achieve support for Python on iOS and Android (as well as looking at a few techniques that don’t work).
Along the way, it will hopefully inspire you to see the possibilities for Python on Mobile as a platform, and expose you to some interesting features of Python that you may not have encountered previously, like descriptors, metaclasses, bytecode manipulation, and type annotations.