Live data from Hacker News

Python on Android

kivy.org

1–10 of 51 posts

Re: Python on Android

#3
Kivy is really cool, but getting started on it sort of sucks. Lots of compilation errors (especially if you're trying to install on windows) due to its dependencies on pygame (and therefore cython, and therefore a particular version of MSVS for the specific dll... all a hassle). The on-site tutorials are sort of obtuse too, if you're looking to do UIs rather than games - until other resources[1][2] became available, I sort of just gave up because it didn't seem worth it to jump through the hoops for a new framework.

1 http://inclem.net/pages/kivy-crash-course/

2 http://pythonthusiast.pythonblogs.com/230_pythonthusiast/arc...

Re: Python on Android

#4

Kivy is really cool, but getting started on it sort of sucks. Lots of compilation errors (especially if you're trying to install on windows) due to its dependencies on pygame (and therefore cython, and therefore a particular version of MSVS for the specific dll... all a hassle). The on-site tutorials are sort of obtuse too, if you're looking to do UIs rather than games - until other resources[1][2] became available,…

On Ubuntu it's really easy though. This is why I switched OSes a few years ago. Things are just easier if you use the same platform as other developers.

Re: Python on Android

#5
post #4

Kivy is really cool, but getting started on it sort of sucks. Lots of compilation errors (especially if you're trying to install on windows) due to its dependencies on pygame (and therefore cython, and therefore a particular version of MSVS for the specific dll... all a hassle). The on-site tutorials are sort of obtuse too, if you're looking to do UIs rather than games - until other resources[1][2] became available,…

On Ubuntu it's really easy though. This is why I switched OSes a few years ago. Things are just easier if you use the same platform as other developers.

Or just run a VM

Re: Python on Android

#7
So, I've actually been working for the past while on a project to allow building more native apps on Android using Python. It is built on the Kivy tools, but I have had to make some changes to python-for-android specifically because it's not as seperated from Kivy as the developers think. I've also had to make a small change to PyJNIus, as it has a dependency on SDL when on Android.

The reason I chose to work on this is while you can already create an application using Kivy, it sort of exists in its own world compared to standard Android apps. Because you don't have separate activities, you can't really do stuff like have one of them be launched to handle a specific file or URL (disclaimer: what I'm building can't either yet). There's also the same issues you get with mobile apps that are web apps in an APK, where someone has attempted to reimplement native UI widgets and there's certain behaviours that are not quite right or missing, or you can't use them yet because they haven't been replicated in your environment yet.

So basically what I'm doing is the Python equivalent of Xamarin.Android (https://developer.xamarin.com/guides/Android/ ) built on some of the Kivy tools. The idea is that you'd have the bulk of your logic in cross platform Python and a thin UI layer for any platforms you had. And in the future if someone made a similar thing for iOS, you could build a layer overlying the two of them and get actually native behaviour on both.

Overall I've gotten it to the stage where you can create activities, access some standard UI elements and launch third-party apps via Python code, but like I said, it's still at a pretty early stage.

I'd intended to open source it when it got to a more usable state, as it's pretty much in proof of concept state atm. (bugs ahoy, tests and docs are very lacking, feature coverage is low, setup is a PITA, and the API is too close to the Java API to make for nice Python). These are problems I believe are fixable. If you want to see the current state of it though, it's on https://bitbucket.org/tonyfinn/pydroid , but it's a bit off how far I'd like to be before sharing it.

Re: Python on Android

#9
post #7

So, I've actually been working for the past while on a project to allow building more native apps on Android using Python. It is built on the Kivy tools, but I have had to make some changes to python-for-android specifically because it's not as seperated from Kivy as the developers think. I've also had to make a small change to PyJNIus, as it has a dependency on SDL when on Android. The reason I chose to work on this…

This looks really cool, thanks for sharing it. I've seen this kind of idea talked about many times, but never any implementation, and even if at an early stage there's clearly a lot of effort in your basic structure and api (edit: and docs!).

Re: Python on Android

#10

Kivy is really cool, but getting started on it sort of sucks. Lots of compilation errors (especially if you're trying to install on windows) due to its dependencies on pygame (and therefore cython, and therefore a particular version of MSVS for the specific dll... all a hassle). The on-site tutorials are sort of obtuse too, if you're looking to do UIs rather than games - until other resources[1][2] became available,…

Ultimately, short of Android becoming a widely supported platform for Python and having binaries available on PyPI, there's not much that can be done for this. Compiling stuff on Windows is a bit of mess, but a surprsing number of Python libs use or rely on others that use C extensions.

In normal use on Windows, this isn't as noticeable as these projects either have binaries on PyPI for Windows or else installers from their own site, but when you actually do need to compile stuff (because you're cross compiling for Android), it's a bit of a mess.

Post reply on HN