How to develop programs for Android through Python?

Asked

Viewed 35,240 times

11

To develop programs for Android in Python it is necessary to build a framework in such a way that the application is executable on Android phones?

I am new as Android programmer, I am studying and I know that Python has a great portability. How can I write programs for Android in Python? It is possible?

  • You may run away from the subject, but if you have knowledge of C# and prefer it to Java I recommend you take a look at Xamarin. Xamarin

2 answers

7

You can take a look at the framework Kivy, it is open source, developed in Python to program in Python, focused on modern applications, being cross-platform, multi-touch, open source, simple and fast.

About the installation and requirements you can take a look at the answer to this question from Soen, I will not venture to translate the answer, for my English is still poor.

For more on the kivy you can refer to Documentation or the project in Github, there is also this talk on youtube on the development of apps with Kivy.

Note: I have never done installation or testing with Kivy I just read about him in some community posts Python, then I can not give more detailed information about the Kivy.

  • 2

    Hello Snickers. The information you posted is very generic, and so the answer is practically dependent on the links. If you don’t know the tool, you might want to point it out in a comment. Or you can try to give an overview of your use, post an example, or even "translate" the Soen response you referenced (among other options), thus making your response potentially more useful to the community. :)

4

Another alternative is the QPython that allows you to create and execute scripts on Android, it comes with a development kit that contains:

  • Console: A console for regular Python, feel free to communicate with interpreter directly.
  • Publisher: Qpython has a good integrated text editor, you can write the code and run it without leaving the application.
  • My Qpython: Here you can find your scripts and projects.
  • System: Maintenance of libraries and components, install and uninstall them.
  • Package Index: Opens the page Qpypi in the browser that allows installing packages listed there.

inserir a descrição da imagem aqui

A Hello World in Qpython:

import androidhelper

ah = androidhelper.Android()
response = ah.dialogGetInput("Hello", "Enter your name:")
message = 'Hello, %s!' % response.result
ah.makeToast(message)

You can find more information on qpython wiki. On the page Mobile Device Editors has a list of IDE’s which are executed on mobile devices and tablets.

  • Would you know to say (without going into too much detail) if it is possible to create "standalone" applications using this kit? Type, you develop and publish in an app store, without needing the end user to download Qpython, download its code and run manually. If it is limited to scripts (as seems to be the case, I have not found any option to deploy), this greatly reduces its usefulness... (besides, I don’t feel comfortable installing an application that runs arbitrary code - especially if it needs me to give it fairly comprehensive permissions)

  • It would also be interesting to put some example of code, use or integration with the kit, so that the answer becomes more interesting and useful. As it stands, it seems more like a comment to me than a response.

Browser other questions tagged

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