Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Is there such a thing as a "translator" (for lack of a better word in my mind now) that translates Python code directly to JVM / Dalvik bytecode?

Would be great for writing Android applications in Python!

NOTE : I know about the scripting capabilities of the Android platform but I am looking for something that would generate a '.apk' without having to install the 'scripting' package... annoying for end-users.

Yes you can go to Java bytecode using jythonc . Though I'm not sure how well that would work with the Dalvik format's subtle differences.

edit : apparently there was a jythonroid project which aims to do exactly what you want, but they abandoned it in favor of SL4A

According to the Wikipedia entryon Dalvik and Daniel's answer, I think you may try compile into Java bytecode using jythonc and then use the dx tool to convert it to .dex files.

From the wikipadia:

A tool called dx is used to convert some (but not all) Java .class files into the .dex format.

Let us know if this works.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .