Abstract Classes in Pyjnius

197 views
Skip to first unread message

Micah Johnson

unread,
Jan 4, 2016, 10:10:59 PM1/4/16
to Kivy users support
I am building an app that receives data from a custom built Bluetooth low energy device. Development info regarding BLE in Kivy is pretty scarce, but what I did find was this conversation in the Pyjinius development group which was very helpful (https://groups.google.com/forum/#!topic/pyjnius-dev/yId8td6YZiI).

The conversation at one point states that there will never be a way to implement an abstract java classes using Pyjnius. The reason this matters is because the BluetoothGattCallback in Android is an abstract class, thus presenting a significant hurdle. The conversation is fairly old, so I am curious if this is still the case? 

I saw that there is a lengthy work around to the problem but I wanted to check first.


Message has been deleted

Rafał Kaczor

unread,
Jan 5, 2016, 5:40:43 AM1/5/16
to Kivy users support
I suggest you to try writing your own bridge class in Java, implementing the abstract class and wrap functionality you want in Kivy into public Java methods. Than you will be able to compile the java class with your project via buildozer and use the API you created with pyjnius ;)

All the best

Micah Johnson

unread,
Jan 7, 2016, 12:33:24 PM1/7/16
to Kivy users support

Well that's what I was hoping to avoid. But I will give it a try . In the pyjnius support group link I referenced above, one user comments roughly how it is done. So I will follow that and see how it goes. Thanks for the response!

David Torío

unread,
Oct 10, 2016, 5:20:16 PM10/10/16
to Kivy users support
Hi.
In what path must I put the java class?
Thanks in advance.

niavlys

unread,
Oct 11, 2016, 1:39:55 AM10/11/16
to Kivy users support
Hi,

whatever, as long it's being referenced in your buildozer.spec:

# (list) List of Java files to add to the android project (can be java or a
# directory containing the files)
#android.add_src =

watson Xi

unread,
Oct 21, 2016, 6:58:12 PM10/21/16
to Kivy users support
Hello, 

Was this solved? Does anyone have example code that shows this process? 

Working through the same thing for a heart rate monitor.

Cheers,
Watson
Reply all
Reply to author
Forward
0 new messages