是否可以使用 SL4A 创建完整的 Android 应用程序?

发布于 2024-12-23 17:32:50 字数 552 浏览 2 评论 0原文

我想用 python 创建一个应用程序,但我需要它包含正确运行所需的所有内容。我看过这篇关于销售能力的帖子该应用程序通过和市场,但那里没有最终答案。

目前我能找到的最佳解决方案是在此 pdf 章节(来自 Pro SL4A Apress 书),但似乎即使我创建了一个.apk 文件,安装该应用程序的用户必须在其 Android 设备上安装 SL4A。

有没有办法将 SL4A 合并到 .apk 文件中,或者更好的是,只合并所需的内容?

I would like to create an App with python, but i need that it includes all it needs in order to operate correctly. I have saw this post about the ability to sell the app via and Market, but it didn't have a final answer there.

Currently the best solution i could find, is at this pdf chapter (from Pro SL4A Apress book), but still it seems that even if i create an .apk file, the user whom install that app would have to have the SL4A on his Android device.

Is there a way to incorporate the SL4A in the .apk file, or better yet, to incorporate just the needed stuff ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

后知后觉 2024-12-30 17:32:52

据我所知,以这种方式创建的 APK 不包含 SL4A 提供的脚本解释器。但是,根据您发布的 PDF,它应该在安装 APK 时请求安装 SL4A 和相关的脚本解释器。

As far as I'm aware, APKs created this way don't include the script interpreters that SL4A provides. According to the PDF you posted, it should request for SL4A and the relevant script interpreter to be installed when the APK is installed, however.

初雪 2024-12-30 17:32:52

这个问题现在已经很老了,但是对于可能来到这里的任何其他用户来说,现在可以将 Python 解释器嵌入到 APK 包中。请查看此项目,了解相关说明和方法。

This question is now quite old, but for any other users who might come by here, it is now possible to embed the Python interpreter in an APK package. Look at this project for instructions and methods of doing so.

一梦浮鱼 2024-12-30 17:32:52

因此,通过书中描述的方法编译 APK 时实际发生的情况与您所描述的有点不同。 实际发生的情况是,在安装 APK 文件时,它会检查用户是否安装了Python而不是 SL4A。如果用户没有安装 Python,它将提示下载,类似于某些应用程序提示安装 BusyBox 以使用某些命令的方式。这意味着用户不需要有脚本环境,甚至不需要知道 python 是什么。

至于将第 3 方模块/库编译到您的 APK 中,发生的情况是当您编译时在 Eclipse 中,它将指向计算机上包含 python 的文件夹,并从那里进行编译。 这意味着为了将额外的模块或库添加到 APK 中,您所需要做的就是确保它们包含在 Eclipse 编译 APK 时查找的文件夹中。 默认情况下,我认为这是你的本地Python文件夹,但我不是100%确定,所以如果我错了,请有人纠正我。

希望这有帮助!

so what actually happens when compiling an APK via the method described in the book is a little bit different than what you have described. What actually happens is that upon installation of the APK file it will check to see if the user has Python installed, not SL4A. If the user does not have Python installed it will prompt for a download, similar to how certain applications prompt to install BusyBox in order to use certain commands. This means that the user doesn't need to have a scripting environment, or in fact even know what python is.

As for compiling 3rd party modules/libs into your APK, what happens is when you are compiling in Eclipse it will point to the folder on the computer containing python, and compile from there. That means that all you need to do in order to get extra modules or libraries into the APK are to make sure that they are included in the folder that Eclipse looks to when compiling the APK. By default I think that is your native Python folder, but I'm not 100% sure so somebody please correct me if I am wrong.

Hope this helps!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文