4

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 ?

Community
  • 1
  • 1
Hanan
  • 1,169
  • 3
  • 23
  • 40

3 Answers3

3

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.

Rohaq
  • 1,886
  • 1
  • 15
  • 22
2

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.

ShankarG
  • 1,105
  • 11
  • 26
0

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!

John Dorian
  • 1,884
  • 1
  • 19
  • 29