Python algorithm library for Android & iOS

65 views
Skip to first unread message

Kevin Koch

unread,
Jul 11, 2018, 9:02:35 AM7/11/18
to Kivy users support
Hi there,

we developed several algorithms in Python that were ideated as prototypes for a mobile app. We explore now further steps how these algorithms can be brought into our mobile app: either we code these algorithms for each platform native, translate them into c/c++ or use some external library that maybe translates the Python code in some way.

My question is: can we create a library app for iOS and Android with Kivy which we can embed into our main app?
If yes, how can this be done?

I searched already in the documentation, however complete apps (including GUI) are discussed...

Thanks in advance!

Andreas Ecker

unread,
Jul 11, 2018, 9:52:47 AM7/11/18
to kivy-...@googlegroups.com
The big advantage of the kivy framework is actually that you can use your python algorithm library unchanged in both iOS and Android - if your libraries are pure Python code.

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kevin Koch

unread,
Jul 11, 2018, 10:07:24 AM7/11/18
to Kivy users support
Thank you Andreas for your reply. Yes, my code is purely Python (with the use of some libraries as Numpy or Pandas).

So, I can embed my written Python code as a library in another app?
Is there any example where this is done? Would appreciate a push in the right direction.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.

Andreas Ecker

unread,
Jul 11, 2018, 12:36:39 PM7/11/18
to kivy-...@googlegroups.com
Pure Python code can be put and distributed to iOS/Android directly with your kivy app (in the same folder where your main.py is stored or within a sub-folder of it).

Numpy is not pure Python (afaik). For these sub-libraries you need a p4a (python-for-android) recipe to cross-compile the C/C++ parts of this library to your target OS (e.g. Android) - see http://python-for-android.readthedocs.io/en/latest/recipes/

Buildozer is a great tool for to make the cross-compiling and the inclusion of external C/C++ libraries much easier, see here: http://buildozer.readthedocs.io/en/latest/



To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+unsubscribe@googlegroups.com.

Kevin Koch

unread,
Jul 12, 2018, 3:11:19 AM7/12/18
to Kivy users support
Thanks! I will check it out.

qua non

unread,
Jul 12, 2018, 3:21:36 AM7/12/18
to kivy-...@googlegroups.com
kivy apps are nothing but integration of native apps loading python libraries  and a open gl interface on top

You have 2 options: 
1. Include the python interpreter compiled for the relative mobile platform in your app like kivy apps do.
2. Create a `library app` as you call it that runs this python interpreter as a service that other apps can interact with

for 1 you have existing codebase of kivy-ios and python-for-android that shows you how to do this.
for 2 you would again have to is kivy's codebase as a example to get your library app up.

Relevant code at 


Regards
Akkshay



Kevin Koch

unread,
Jul 12, 2018, 10:48:52 AM7/12/18
to Kivy users support
After exploring a bit, I see that Kivy as a whole framework is probably not the right thing for me. I do not need a full app, I just need a way to use a python interpreter within my possible library.
qua-non/Akkshay describes probably the way to go for me - using the python interpreter in a self created library.

I moved this question to Stackoverflow (with including a broader picture) https://stackoverflow.com/questions/51290516/can-i-create-based-on-python-code-executable-code-for-android-and-or-ios, maybe someone here has a good answer. Thanks for all your help!
Reply all
Reply to author
Forward
0 new messages