Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programming Android apps in jython

The other day I came across a Python implementation called Jython.
With Jython you can write Java applications with Python and compile them to pure Java.

I was wondering: Android programming is done with Java.
So, is it possible to make Android apps with Jython?

like image 437
mid_kid Avatar asked Jun 20 '12 12:06

mid_kid


People also ask

Can I use Jython on Android?

It's not possible. You can't use jython with android because the DVM doesn't understand it. DVM is not JVM.

Can Android apps be coded in Python?

You can definitely develop an Android app using Python. And this thing is not only limited to python, you can in fact develop Android applications in many more languages other than Java. Yes, in point of fact, Python on android is a lot easier than Java and much better when it comes to complexity.

What can I do with Jython?

Jython is a version of the Python programming language that runs on the Java platform. It allows users to write programs in Python and compile them to Java bytecodes that run directly on a Java Virtual Machine, or JVM.

Is Jython a scripting language?

Even with the given limitations, Jython is a powerful language for ImageJ scripting.


1 Answers

Jython doesn't compile to "pure java", it compiles to java bytecode - ie, to *.class files. To develop for Android, one further compiles java bytecode to Dalvik bytecode. This means that, yes, Jython can let you use Python for developing Android, subject to you getting it to play nice with the Android SDK (I haven't personally tried this, so I don't know how hard it actually is) - you do need to make sure you don't depend on any Java APIs that Android doesn't provide, and might need to have some of the Android API .class files around when you run jython. Aside from these niggles, your core idea should work - Jython does, indeed, let write code in Python that interacts with anything else that runs on the JVM.

like image 160
lvc Avatar answered Oct 17 '22 02:10

lvc