Can I build library using buildozer?

55 views
Skip to first unread message

Shafi Mehedi

unread,
Sep 30, 2019, 5:47:52 AM9/30/19
to Kivy users support
I am working on a project where I need to use numpy for some calculations. My entire app is already built on JAVA. So I want to make a library module using kivy like we can build .aar . So that I can call the functions of numpy as function call from my JAVA side of the project?
Is there any way of doing this? 

Sorry if this is a duplicate question. I have searched the issue board and this group for similar message as well. 

Side note: I have written and tested an app which has the function I need to use in my app. Therefore I have the basic idea of KIVY. 

Andrei Sima

unread,
Sep 30, 2019, 6:59:55 AM9/30/19
to Kivy users support
I do not think that such thing is possible since python is running on android in his own shipped interpreter.
As far as i know there is no API for this.


____________________
Andrei Sima
0723.223.883


--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/53afa57e-12a6-464f-a2a1-2889003e20aa%40googlegroups.com.

Michael Kramer

unread,
Sep 30, 2019, 10:25:27 AM9/30/19
to Kivy users support
I have played with this and there is a way to do it, but perhaps not too cleanly.

It is possible to keep the SDL view that is created in the PythonActivity around but not use it as the main view for the app.  This will basically run a kivy app in the 'background' of your app with java views.

The next step is to create a kivy app that does not rely on any UI components to handle calls from your java source  - but it needs to be an instance of kivys App() to keep python running in the background and it can basically hang out in an infinite while loop. 
From there you can write a java interface in python and jnius that supports calling your python code from java.

I've tried this with numpy for a similar 'java-to-numpy' experiment and it took a bit of massaging of the data when going back and forth across the jni boundary but it was able to call numpy functions from a java app.

It takes a bit of work but there is light at the end of that tunnel



--

Shafi Mehedi

unread,
Oct 2, 2019, 5:01:19 AM10/2/19
to Kivy users support
Is it possible for you to send me an example or more detailed walk through? 
I have created an APP before which had basically a service running in background with KiVy. I tried invoking the service with classname (taken from dist/app/src/manifest.xml) my another APP in JAVA. Android shown the service to be found and started but it wasn't running at at all. 
It would be of great help. Thanks. 
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages