Is it possible to create a complete Android application with SL4A?

I would like to create an application with python, but I need it to include everything necessary for the correct operation. I saw this post about the possibility of selling the application through Market and Market, but he did not have a final answer.

Currently, the best solution I can find is in this pdf chapter (from the Pro SL4A Apress book), but still it seems that even if I create the .apk file, the user who installs this application will need to have SL4A on his Android device .

Is there a way to include SL4A in an .apk file or, better yet, include only the right materials?

+4
source share
3 answers

As far as I know, the generated APK files do not include the script interpreters that SL4A provides. According to the published PDF file, it should request SL4A and the corresponding script interpreter, which will be installed when the APK is installed.

+3
source

This question is quite old, but for any other users who may come here, you can now embed the Python interpreter in the APK package. See this project for instructions and methods for this.

+1
source

so what actually happens when compiling the APK using the method described in the book is slightly different from what you described. What is really going on , so this is that after installing the APK file, it will check if the Python user is installed, not SL4A . If the user does not have Python installed, a download is requested , similar to how some applications request a BusyBox installation to use certain commands. This means that the user does not need to have a scripting environment or actually even know what python is.

As for compiling third-party modules / libs into your APK, what happens when you compile in Eclipse, it points to the folder on the computer containing python and compiles from there. This means that all you need to do to get additional modules or libraries in the APK is to make sure they are included in the folder that Eclipse is looking for when compiling the APK. By default, I think this is your native Python folder, but I'm not 100% sure, so someone, please correct me if I am wrong.

Hope this helps!

0
source

Source: https://habr.com/ru/post/1388887/


All Articles