Developing Android apps using Python

Asked

Viewed 13,158 times

14

Is it possible to create Android apps with the Python language? If yes, how does it work?

  • If you don’t know how to get started, it’s using the Kivy framework, http://kivy.org Read the documentation.

1 answer

13

Yes, it is possible.

Once I saw a discussion about it in the list of the Fedora infrastructure, indicated this sdk: https://github.com/kivy/python-for-android?source=c

She turns a program into Phyton in an apk. I used very little.

Follow a famous Helloworld:

import kivy
kivy.require('1.0.9')
from kivy.lang import Builder
from kivy.uix.gridlayout import GridLayout
from kivy.properties import NumericProperty
from kivy.app import App

Builder.load_string('''
<HelloWorldScreen>:
    cols: 1
    Label:
        text: 'Welcome to the Hello world'
    Button:
        text: 'Click me! %d' % root.counter
        on_release: root.my_callback()
''')

class HelloWorldScreen(GridLayout):
    counter = NumericProperty(0)
    def my_callback(self):
        print 'The button have been pushed'
        self.counter += 1

class HelloWorldApp(App):
    def build(self):
        return HelloWorldScreen()

if __name__ == '__main__':
    HelloWorldApp().run()

Just use the command below to generate apk.

./distribute.sh -m 

Here is the complete documentation (English): http://python-for-android.readthedocs.org/en/latest/

  • Putz man, I can’t stand Java and so I was resistant to developing for Android. Thank you. Now I see a new light at the end of this tunnel.

  • thank you, it has been very helpful to know that I can make app with python. I am starting in this language. thank you very much!!!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.