55

I've just started diving into the Android world. I have a lot of experience programming apps in Python, so I've searching for a good combination "Android + Python", and I think I've found it: Kivy.

I need to make applications that are able to download and upload content from the internet, maybe some connection with the map component included in Android and more stuff to make a nice Android app.

But I really don't want to waste my time on something that maybe won't work. So, does anyone has some experience developing Android apps using Kivy? Is it really useful, simple, possible? Or is there a better option you have in mind?

juliomalegria
  • 24,229
  • 14
  • 73
  • 89
  • What are your experiences with Kivy so far? Does it support some Android features, such as getting GPS location or reading contacts list? Any thoughts after you presumably have been using Kivy for a while now? – Tadeck Mar 24 '12 at 04:25
  • 1
    @Tadeck I have to admit that, like many others, I gave up to the idea of ​​using Kivy, due to poor documentation and almost non-existent active community. – juliomalegria Mar 24 '12 at 17:21
  • 6
    The kivy is not almost non-existent. I get an answer for my questions everytime I ask them on their IRC channel. – Joschua Jan 18 '13 at 19:05
  • 2
    I get a hand-on on Kivy, although I still have to explore its performance concern (heck, initially we all have performance concern when first doing any Python development), up to now, it works great. I've made some tutorial on it : http://tinyurl.com/pythonthusiast-kivy-1 hope it helps! – swdev Jan 22 '14 at 02:22
  • I created an Android game that is completely developed in Python using Kivy. It is called **CoinTex** available here at Google Play: https://play.google.com/store/apps/details?id=coin.tex.cointexreactfast. The source code of the game is available here at GitHub: https://github.com/ahmedfgad/CoinTex. I also wrote a book that will be published this year for building Android apps using Python. It is titled "**Building Android Apps in Python Using Kivy with Android Studio: With Pyjnius, Plyer, and Buildozer**" available here at Amazon: https://www.amazon.com/dp/1484250303. – Ahmed Gad Jul 23 '19 at 00:59

4 Answers4

24

I've been using and contributing to kivy for some time, and using it for a big application intended for market. Although still not as complete as native developpment (not sure if using the map Android API is possible at all, but there are alternatives), it works very well, with good performance. The kv language for rapid prototyping is really cool.

And as bonus points, your apps work on windows/linux/mac/ios too… (we still have to try getting on apple store, but technically it works). edit: to this day at least one kivy app has been accepted on apple market, look for "deflectouch" if you are interrested.

As opposed to SL4A, you get a real apk to distribute, with kivy as well as a very nice and slick GUI api, fitted for multitouch apps.

prtksxna
  • 643
  • 6
  • 17
Tshirtman
  • 5,859
  • 1
  • 19
  • 26
  • 1
    Kivy looks very good, has a great potential as far as interface is concerned. But what about Android API? Is there a way you can use it (eg. like in SL4A)? I am really interested in Kivy, but I haven't found any information regarding eg. reading GPS location data, creating a toast, reading contacts list, nor have I found the information about such features being unavailable from Kivy app. Do you know something about that? – Tadeck Mar 24 '12 at 04:33
  • 2
    kivy android port is based on pgs4a, so you have access to this module http://pygame.renpy.org/api.html#module-android it's not part of kivy api because it's non portable (android only). – Tshirtman Apr 01 '12 at 16:06
  • @tshirtman, Hi, Thanks for the youtube video you made, it gave me a push in Kivy while trying to find my way through. I can see most of your contributions on StackOverflow are on Kivy, that's great, we will be in touch soon on SO :) – securecurve Jan 24 '13 at 13:46
  • 2
    As an update (as i got a recent upvote on this), there has been a lot of progress on android integration since, thanks to PyJNIus, which allows to autowrap java libs and use them from python, it's cool on the desktop, but even cooler on android, since you can use most of the android API using it, with just a few lines of declarations to get your native java objects in python, and call their methods. – Tshirtman Nov 25 '13 at 12:29
  • Hi securecurve. Would you please post a link to the tshirtman video you were talking about? Thanks. – Love and peace - Joe Codeswell Mar 19 '14 at 16:38
  • I have a few yt videos about kivy stuff, i suspect he was talking about http://youtu.be/S2sFqFGDu1k, but http://youtu.be/TUXfaiFxhNo, http://youtu.be/21BeRU7w8Nw, http://youtu.be/ElmFQGTTvmA, http://youtu.be/2vz-hGW82WY, http://youtu.be/-iqi-3vw9zY or http://youtu.be/VZltsCySHlI could interest you as well, howether, to learn deeper about kivy, i would really recommand Alexander Taylor's kivy crash course series: https://www.youtube.com/playlist?list=PLdNh1e1kmiPP4YApJm8ENK2yMlwF1_edq – Tshirtman Mar 20 '14 at 17:19
13

I believe KivyMaps is pretty similar to what you are trying to do.

If you avoid non-Android platform specific code then your application, should run on Android without any problems.

I suggest looking at Python for Android also, it's a sister project of Kivy aiming to help you create your own Python distribution including the modules you want, and create an apk including python, libs, and your application. Specifically look at its native API wrappers for Android. The project is new so only a few native API's are supported but it might give you an idea on as to how to go about creating a wrapper for Android location service API's if you need that.

As for the Google maps external library, I agree with tshirtman. I'm not sure how it could be used but as the KiviMaps link above highlights there are alternative approaches available.

Community
  • 1
  • 1
qua-non
  • 4,152
  • 1
  • 21
  • 25
3

I have very little experience with it. But I do know that

SL4A (Scripting Layer For Android) does support writing Android applications with Python as well. Might be worth looking into that a bit before you make your decision of what to use.

Tadeck
  • 132,510
  • 28
  • 152
  • 198
FoamyGuy
  • 46,603
  • 18
  • 125
  • 156
  • 2
    I've read that SL4A allows you to run Python scripts in Android but it doesn't allow you to create real Android apps, do you know something about that? and what do you know about Kivy from your little experience? – juliomalegria Jan 23 '12 at 04:47
  • last I knew there was not a way to wrap your python scripts into an apk file within sl4a. However It seems Tasker has the capability to launch individual sl4a scripts (including python ones) with or without showing the console output. And if tasker is able to do that, it seems feasible that you could somehow make an apk that contained the python scripts and was able to launch them in the same fashion that tasker can. – FoamyGuy Jan 23 '12 at 14:52
0

Kivy is Cross-platform Python Framework for NUI Development. It is Good for some prototyping android app. You can use Kivy Launcher for more fast test. You can use python library so fast development for feature. You can use pyjnius for accessing java classes for java based feature.

I suggest you to reading Kivy Interactive Applications in Python book for newbie.

But in some deeper depth, you should know how to use basic widget carefully. Because some confusing concept is there. For canvas, it's different concept in html5. Kivy language's class rule and class is some confusing for newbie.

And for android app, there is some difficult to use not basic supported library like Beautiful Soup(famous html and xml parser library).

Paul Go
  • 69
  • 1
  • 1
  • 8