Real Python - Python for mobile development?

Hey there,

What about using Python for mobile app development?

Historically, Python didn't have a strong story when it came to mobile application development.

In fact, Android and iOS development was pretty much out of the question with pure Python alone.

That's a shame—

And thankfully, there have been a number of developments in recent years that vastly improved the outlook on using Python for writing mobile apps.

So let's take a look at a few options. There are two frameworks I'd like to call out specifically:

The first framework is called Kivy. It's an open-source Python library for developing cross-platform GUI applications. 

Kivy allows you to write pure-Python graphical applications that run on the main desktop platforms (Windows, Linux, and macOS) and on iOS & Android.

Every time I hear about a new GUI toolkit I always want to know how "native" it feels—

I believe that great GUI application should play to the strengths of the platform they run on.

For example, when I'm using my iPhone I want consistency across the apps I use. It feels jarring to use an app that was designed with user interface patterns from another platform. 

Kivy comes with a custom-built UI toolkit that provides it's own versions of buttons, text labels, text entry forms, and so on. This means these widgets are not rendered using the native platform UI controls. 

On the one hand this guarantees consistency and portability of your app from one platform to another. 

But on the other hand it also means that your Android app won't really look and feel like an Android app...

This might not be a problem at all, depending on the kind of app you have in mind. 

For most games, for example, the "nativeness" of the UI isn't very important. The same is true for certain kind of niche apps like graphical MIDI controllers for making music.

But for other types of apps this has a HUGE impact on usability.

So, if you can work with a non-native UI toolkit in your apps then Kivy is a great choice. 

It allows you to write mobile applications using your Python programming skills without having to learn another platform-specific language like Swift.

You can learn more about Kivy at https://kivy.org

The second framework I want to tell you about is called the "BeeWare" project.

It offers you a set of tools and an abstraction layer you can use to write native-looking mobile and desktop applications using Python.

The key difference between Kivy and BeeWare is that BeeWare programs use the native UI toolkit of the platform they run on, whereas Kivy apps use a custom UI toolkit that uses the same controls across all platforms.

With BeeWare, the UI controls your app uses will be the buttons, check boxes, and form elements provided by the underlying operating system.

This means you can build apps that look and feel 100% native to each specific mobile (and desktop) platform.

Sounds great, right? 

The only downside is that the BeeWare project is still relatively new and currently under heavy development lead by Pythonista Russel Keith-Magee.

As with any framework that hasn't had a chance yet to mature for years this means more work for you as a developer due to (potentially frequent) API changes, bugs, and lack of features.

Nevertheless, I'd encourage you to read up on BeeWare, it's a really exciting project. You can learn more about it here: https://pybee.org/project/using/

Now, which way should you look if you want to build a mobile app with Python?

Both Kivy and BeeWare are worth considering.

And as far as maturity goes, Kivy seems to be the more mature platform right now. 

For the use cases that I'm personally the most interested in—making native-looking mobile and desktop apps with Python—I think that BeeWare will eventually gain the upper hand.

But, to be honest with you, if you're thinking about writing a great mobile app today it might not make much sense to build it with Python...

If you want the best result and use state of the art platform-specific features, your best bet will be getting comfortable with Java (Android) and Swift (iOS).

However, I believe this can and will change in the future. Python's future in the mobile dev space is looking brighter by the minute.

And with Python's rising popularity there's a great argument to be made for using it for mobile app development.

Personally, I'd *love* to have the ability to write cross-platform mobile apps with Python, simply because Python is such an enjoyable language to work with.

I'm excited to see what the possibilities will be in a year from now. 

So, if you're looking for a cool open-source project to contribute to, please consider Kivy and the BeeWare project. 

You'll help create a better future for all of us :-)

Happy (mobile) Pythoning!

— Dan Bader

Older messages

[PythonistaCafe] Why PythonistaCafe exists

Friday, January 22, 2021

Hey there, In one of my last emails I talked about how some online communities in the tech space devolve over time and turn into cesspools of negativity. This relates directly to how and why I started

[PythonistaCafe] What makes PythonistaCafe different

Thursday, January 21, 2021

Hey there, Mastering Python is *not* just about getting the books and courses to study—to be successful you also need a way to stay motivated and to grow your abilities in the long run. Many

Picking Python projects -- I'M STUCK

Sunday, January 10, 2021

Hey there, I got this question from a newsletter reader who's an entry-level Pythonista: ~~~ What's the best way of moving from a basic understanding of Python to working on real projects? And

Parallel computing in Python (in 60 seconds or less)

Friday, January 1, 2021

Hey there, If your Python programs are slower than you'd like you can often speed them up by *parallelizing* them. Basically, parallel computing allows you to carry out many calculations at the

Python side projects & getting a job

Sunday, December 20, 2020

Hey there, Where do you find inspiration for Python side projects? It's a question I often hear from Pythonistas looking to build up a portfolio they can show to potential employers. So here's

You Might Also Like

Visualized | Interest Rate Forecasts for Advanced Economies 📈📉

Monday, May 6, 2024

In this graphic, we show the IMF's interest rate forecast for the US, Europe, the UK, and Japan for the next five years ahead. View Online | Subscribe Presented by Voronoi: The App Where Data Tells

⚙️ Apple AI updates

Monday, May 6, 2024

Plus: X AI stories & YouTube "skip to the good part" ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

Unlock Time Series Data, FTC Chair Joins StrictlyVC & More

Monday, May 6, 2024

TechCrunch Events Roundup | May 6 TechCrunch Events TechCrunch events roundup Unlock the power of time series data with industry experts from AWS and InfluxDB on May 16. Join us next week for this free

Deepdive – product strategy, AI, leadership, emotional intelligence

Monday, May 6, 2024

Earlier this month, we presented our Virtual edition of INDUSTRY: The Product Conference, featuring some of our favorite product leaders worldwide. There were seven great keynote presentations, live

Noonification: The Human Roots of Rising Fascism

Monday, May 6, 2024

Top Tech Content sent at Noon! Get Algolia: AI Search that understands How are you, @newsletterest1? 🪐 What's happening in tech today, May 6, 2024? The HackerNoon Newsletter brings the HackerNoon

Code Story - Apr 24

Monday, May 6, 2024

Welcome to the April addition of the podcast newsletter. Please enjoy, and check out any of the episodes you might have missed below. ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

Dell turns 40: How a teen founded a tech giant

Monday, May 6, 2024

Samsung's new entry-level OLED TV; Google Threat Intelligence -- ZDNET ZDNET Tech Today - US May 6, 2024 placeholder Dell turns 40: How a teenager transformed $1000 worth of PC parts into a tech

😸 Talk to your data

Monday, May 6, 2024

🍎 Apple saw a 10% drop in iPhone sales during its earnings call. 🎵 Spotify has quietly moved its lyrics function behind... Product Hunt Read in browser This newsletter is brought to you by YOU MIGHT

GCP Newsletter #397

Monday, May 6, 2024

Welcome to issue #397 May 6th, 2024 News AI Cloud Storage Official Blog PyTorch Introducing Dataflux Dataset for Cloud Storage to accelerate PyTorch AI training Google Kubernetes Engine Official Blog

Jack Dorsey leaves Bluesky

Monday, May 6, 2024

View this email online in your browser By Alex Wilhelm Monday, May 6, 2024 Welcome to TechCrunch AM! It's Monday morning, and the news is already heating up. Today we have notes on Jack Dorsey once