Is it possible to use Python to write cross-platform apps for both iOS and Android?
Asked Answered
D

6

91

Is it possible to use Python to write cross-platform apps for both iOS and Android

Dg answered 19/5, 2012 at 10:5 Comment(4)
duplicate?Kissner
@Kissner i am not convinced by the selected answer of that question, I think it can be used and to confirm I asked that questionDg
Has this changed at all?Nucleolus
Is using pyside, pyqtdeploy a viable option in 2018?Erlanger
D
30

For Android Google provides something called ASE (Android Scripting Environment) which allows scripting languages (Python included) to run on Android. More details here

For iOS, it might be quite a bit more complicated (and I'd advise to check the latest version of iOS SDK agreement to check the current state of the law - apple tends to allow & disallow such apps periodically). For the technical part you might need to interface between Python & Objective C as well as do some wizardry to statically link all the libraries Python requires; full details are available here. Another approach for iOS Python development would be to embed a Python interpreter into you app and distribute your Python script with it (so to play nicely with Apple rules). In this case your Python application would be a Python interpreter which is packaged with your script and runs it automatically.

Second option is to use Kivy framework(kivy.org) - it's a framework to write touch-friendly applications in Python and package them for different platforms. It's had Android support for a while, and recently added iOS support

Dragster answered 19/5, 2012 at 10:7 Comment(2)
also this is precisely the aim of Kivy (kivy.org) - it's a framework to write touch-friendly applications in Python and package them for different platforms. It's had Android support for a while, and recently added iOS supportDragster
Python 3.3+ to iOS is not supported by Kivy yet.Behavior
B
85

An option is kivy: a cool cross platform Python framework which works for Android, Win7, Linux, MacOSX and iOS.

Update: kivy project is growing daily, now supports also Raspberry Pi

Bigwig answered 12/6, 2012 at 16:14 Comment(0)
D
30

For Android Google provides something called ASE (Android Scripting Environment) which allows scripting languages (Python included) to run on Android. More details here

For iOS, it might be quite a bit more complicated (and I'd advise to check the latest version of iOS SDK agreement to check the current state of the law - apple tends to allow & disallow such apps periodically). For the technical part you might need to interface between Python & Objective C as well as do some wizardry to statically link all the libraries Python requires; full details are available here. Another approach for iOS Python development would be to embed a Python interpreter into you app and distribute your Python script with it (so to play nicely with Apple rules). In this case your Python application would be a Python interpreter which is packaged with your script and runs it automatically.

Second option is to use Kivy framework(kivy.org) - it's a framework to write touch-friendly applications in Python and package them for different platforms. It's had Android support for a while, and recently added iOS support

Dragster answered 19/5, 2012 at 10:7 Comment(2)
also this is precisely the aim of Kivy (kivy.org) - it's a framework to write touch-friendly applications in Python and package them for different platforms. It's had Android support for a while, and recently added iOS supportDragster
Python 3.3+ to iOS is not supported by Kivy yet.Behavior
P
5

For writing a GUI applicaion you can use the Toga library,then package it with briefcase into a Android and/or iOS app (or Windows, Linux, macOS etc).

Note: the project is still in alpha state but under rapid development.

Phonologist answered 25/5, 2017 at 9:0 Comment(0)
E
3

As @piertoni mentioned, BeeWare enables native iOS & Android apps to be written in Python.

Externalism answered 8/2, 2019 at 21:6 Comment(0)
I
2

You can try and combine and . The Brython wiki describes how to write an Android app using Brython, which might provide the necessary information to do this also using Cordova. I haven't tested this yet, but it sounds promising. You should however be aware that due to its nature, Brython cannot support x86-compiled packages such as OpenCV (see e.g. here). On the other hand, if you know a bit about JavaScript / HTML5, you can use the WebView native functions, e.g. http://www.brython.info/gallery/three.html.

Incognizant answered 25/4, 2018 at 8:49 Comment(0)
B
0

There's FireMonkey (FMX).

FMX is a fairly new framework for developing cross-platform applications using Python, but I can honestly say that it is the best one currently available!

It's far better than all the other GUI Python Frameworks. With FMX you can develop with a single code base for Windows, MacOS, Android, and Linux.

iOS is not yet supported, but it is planned for in the near future.

I think FMX is worth keeping an eye on.

Bowles answered 30/5, 2023 at 12:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.