I am trying to implement android.bluetooth.le.ScanCallback which is an abstract class using pyjnius. The moment I instantiate the given below python class there is a JVM error. The error states that android.bluetooth.le.ScanCallback is not an interface class. I believe an interface is an abstract class. What am I missing?
class ScanCallback(PythonJavaClass):
__javainterfaces__ = ['android/bluetooth/le/ScanCallback']
def __init__(self, scanCallback, batchCallback=None, errorCallback=None):
super(ScanCallback, self).__init__()
self.batchCallbk = batchCallback
self.scanCallbk = scanCallback
self.errorCallbk = errorCallback
pass
@java_method ('(L/java/utils/List<ScanResult>/)V')
def onBatchScanResults(self,results):
print dir(results)
@java_method ('(I)V')
def onScanFailed(self, errorCode):
print "failed to scan" + str(errorCode)
raise ValueError(str(errorCode))
@java_method ('(IL/android/bluetooth/le/ScanResult)V')
def onScanResult(self, callbackType, result):
print dir(result)