[PyQt] PyQt and JNI
viktorvector at gmail.com
Mon Oct 23 15:30:19 BST 2017
As I see the QAndroidJniObject handles almost everything so that would be
the most useful, however I don't know what would be the minimal subset of
those functions/static members that would be enough. There is a small
example on the Qt blog using the class, maybe those that are used there:
2017-10-23 13:45 GMT+02:00 Phil Thompson <phil at riverbankcomputing.com>:
> On 23/10/2017 17:26, Kálmán Viktor wrote:
>> I've been trying to get the current Android activity using Pyjnius however
>> its autoclass function doesn't recognize my custom Java class.
>> I followed the guide in the Mercurial repo and with minor modifications I
>> can use the built-in Java/Android classes just fine, however to do
>> meaningful on Android a reference to the current activity is needed.
>> What I did was simply extending the base QtActivity class, using it as
>> "entry point" in the Manifest file and trying to get it with Pyjnius's
>> autoclass however it does not find my custom class. Uppon some research I
>> think this the root of the problem:
>> however I've no idea how work around it (even If I modify the Qt source
>> code and patch their JNI_OnLoad somehow to use FindClass to find my custom
>> class I'm not sure it would be in the JNIEnv that is acquired in the
>> function in fake_sdl.cpp)
>> A nicer solution would be to use QtAndroidExtras however it is not
>> supported in PyQt. Are there plans to do it? It would help developing
>> applications immensely on Android.
> Is there a minimal subset of the API that you can specify that would be
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt