Reputation: 4155
I'm trying to write a app for android with kivy. I've been using buildozer, and I can get the touchtracer demo to run on the android device.
So far it's been great, but now I'd like to try using pyserial to get access to the serial port. I've seen this page: https://code.google.com/p/python-for-android/wiki/Modules , which has a built module for pyserial (and even bluetooth, that i'd like to use someday), but doesn't have instructions on how to use them.
Is it just a matter of copying the egg to a certain directory, and it automatically gets built into the final apk? If there are any examples of how to do this with buildozer, I will be greatly appreciative. Googling did not seem to turn up what I was looking for.
Thanks very much in advance!
Upvotes: 2
Views: 2067
Reputation: 29450
The page you linked is for a different python-for-android project, Kivy's is at https://github.com/kivy/python-for-android.
In general, you can include any pure python module in your apk by simply adding it to the requirements line in buildozer, e.g. requirements = pyserial,kivy
.
Modules that are not pure python can be included if there is a recipe available for compiling on android, you can see the available recipes at https://github.com/kivy/python-for-android/tree/develop/pythonforandroid/recipes . If a recipe exists, you simply add the module name to the requirements line as above and it will be used automatically. If no recipe exists then you have to write one, which isn't necessarily very hard.
I don't know anything about pyserial, but it looks like it's probably pure python so you just need to add it as above.
Upvotes: 3