Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tkinter to android translation [closed]

I have a relatively simple tkinter program that just uses Event, Button and Label objects. I would like to translate this to be usable on an android platform.

1) What python for android should I use? QPython, py4a?

2) And on that platform, what GUI module should I use?

I'd like a little bit of detail for why you think a specific module or app would be best, as I'm just getting into the android scene and want to make an intelligent jump.

like image 656
KevinShaffer Avatar asked Jul 18 '13 11:07

KevinShaffer


People also ask

Can tkinter be used for Android?

Unfortunately Tkinter won't work for creating mobile apps as it is meant to be used on desktop only.

Can we convert tkinter into APK?

You cant convert tkinter app to apk files.... python has no builtin or standard support for mobile development.

Can I use tkinter in Pydroid 3?

to run a tkinter program (or any Python program) on Android, you should use the app Pydroid 3 (on the play store), which has a modified tkinter module for Android and much more. To install this module, go in the app's menu > pip > quick install > tkinter .

How can I use tkinter in mobile?

Running the ProgramsInstall the Pydroid 3 app if needed from the Play Store. Download the book's examples package from this location to any writable folder on your phone, and unzip (i.e., extract) it. But navigate the examples-package tree to find additional tkinter code to run.


1 Answers

Even for native purposes, most developers would advise you keep away from Tkinter. It's a dated and unintuitive library that often makes GUI creation and maintenance harder than it needs to be.

The main advantage of developing apps using a Python library and embedding in Android is cross-platform support. These libraries will often allow you to port your app with ease to many different operating systems.

I will not answer which is "best" since this is an opinion-based question outside the scope of StackOverflow, however I will say it is (generally) easier to port from Kivy to android than it is in some other libraries (such as Qt). But take this with a grain of salt. Most libraries nowadays offer advanced GUI capabilities built-in, and your choice will likely not limit you in that regard.

Either way, there is no direct/simple way to translate your Tkinter project to any of these, and you will likely have to rewrite it with the library you end up choosing.

I will add that if your intent is developing only for android, most would advise developing in a native Android language, such as Java or Kotlin, or using a development tool which makes use of such languages. This would result in smaller APK sizes and likely faster running times for your app.

like image 198
yuvgin Avatar answered Sep 28 '22 09:09

yuvgin