How can I package the whole python interpreter in

2019-03-27 03:03发布

问题:

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.