imsparsh / android-python27

Automatically exported from code.google.com/p/android-python27
0 stars 0 forks source link

Undocumented how to distribute egg libraries in self-contained APK #23

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have a working script which depends on a python .egg of PyBluez when run from 
a desktop or android console environment

I cannot establish and it seems undocumented how to package these dependencies 
to satisfy the needs of a self-contained Python APK. I assume I'm getting the 
packaging wrong, which may be why the deployment fails.

The script relies on the python-for-android Bluez .egg at 
https://code.google.com/p/python-for-android/downloads/detail?name=PyBluez-0.19-
py2.6-linux-armv.egg

Can it be recorded how this .egg should properly be distributed to fit in with 
the layout of the standard APK Eclipse .project for creating APK files which 
you have shared via https://code.google.com/p/android-python27/source/checkout

Original issue reported on code.google.com by c...@cefn.com on 18 Mar 2013 at 5:24

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
You cannot use PyBluez-0.19-py2.6-linux-armv.egg as it's linked against 
libpython2.6.so and this project uses Python 2.7 by default, you can use a 
Python 2.6 build from Py4a build, see: 
https://code.google.com/p/android-python27/wiki/TutorialHowToChangePythonBuilds

Or add your modules directly in the Python build process, or create your .egg 
for Python 2.7 (not documented yet)

Original comment by anthony....@gmail.com on 18 Mar 2013 at 6:26

GoogleCodeExporter commented 9 years ago
OK, so I think you're saying I could either 

* work out how to drop the contents of the PyBlueZ .egg file into the 
python_extras_r14.zip from Py4A (Python 2.6), then bundle the 2.6 zips in the 
res/raw directory of the canonical APK, replacing the existing 2.7 ones and 
updating the relevant variables as per 
https://code.google.com/p/android-python27/wiki/TutorialHowToChangePythonBuilds,
 so that the .so which they're linked against is actually there.

* work out how to incorporate the PyBluez source from which the .egg was 
generated into the process at 
https://code.google.com/p/python-for-android/wiki/BuildingPython so that they 
are actually linked to the 2.7 .so in the first place.

Thanks for the response. I hope it's going to clear some serious obstacles for 
me.

Original comment by c...@cefn.com on 18 Mar 2013 at 8:23

GoogleCodeExporter commented 9 years ago
Seems good scheme.

The Python build is different from PY4A, you can check the README here: 
https://code.google.com/p/android-python27/source/browse/#hg%2Fpython-build

Original comment by anthony....@gmail.com on 19 Mar 2013 at 9:21