How can I package the whole python interpreter in an Android APK?

余生长醉 提交于 2020-01-01 04:55:08

问题


I know about SL4A and how I can run Python scripts in Android.

I need to know how I can package the whole Python interpreter inside my APK so my end-users won't have to download and install SL4A before running my App.

Thanks.


回答1:


Try looking at kivy.org.

It's a python on android based Multitouch GUI,inside the documentation is explained how to create a package with all inside to publish on Android shop.

I also remember that there was a chapter on the book Pro Android Python with SL4A explaining how to pack all and publish.

Hope this helps




回答2:


There's the android-python27 project, which actually works with interpreters other than Python 2.7, despite the name. If you want to bundle a Python application with an interpreter in a single APK, that's about the only option. You can use different interpreters and add your own Python libraries and that kind of thing.

It's pretty painful to use to be honest ~ the 'user-friendly' approach requires Eclipse ~ but, if you're ready to package your app, it does the job.

It's available under Apache License 2.0.



来源:https://stackoverflow.com/questions/5704480/how-can-i-package-the-whole-python-interpreter-in-an-android-apk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!