Hey all,
As part of an app I'm working on, I need to embed a web browser and handle its loading callbacks. The sample code for loading android WebKit in Kivy works fine, but unfortunately the WebViewClient used for handling callbacks in android's WebView isn't an interface, but instead is a regular class that requires you to subclass it and override the sublcass methods to handle the callbacks. I didn't see any way to create a Java subclass in Python-land, so I thought I would handle this by creating a Java WebViewCallbacks interface along with a Java WebViewClient subclass that takes a WebViewCallbacks-compliant object on initialization, and calls its methods in the callback handler methods. Then I could (theoretically) use PythonJavaClass to implement the WebViewCallbacks interface in Python-land, and the WebViewClient subclass I assign to my WebView will send messages to that object.
Where I'm getting stuck is in having Python 'see' the classes I created. After creating the classes, I used jar cf to compile the Java sources and passed --add-jar /path/to/my/JarFile.jar to add them to the bundle. Everything completes successfully, and i see a message that my .jar file got put into classes.dex, but I suspect I don't know how to properly reference my Java classes in Python. I tried doing package org.myapp.pywebviewclient at the top of my Java source and then referencing it as org/myapp/pywebviewclient/PyWebViewClient and org/myapp/pywebviewclient/WebViewCallbacks, but I just get errors about those classes not being found.
Is there a way I can debug or inspect the Java code to know how I should be referencing it, or if it is indeed visible to kivy / jnius?
Thanks,
Kevin