pyjnius icon indicating copy to clipboard operation
pyjnius copied to clipboard

Access Java classes from Python

Results 140 pyjnius issues
Sort by recently updated
recently updated
newest added

In java: ```java Double[] doubles = {1.0, 2.0}; // List asList(T... a) System.out.println(Arrays.asList(doubles)); // [1.0, 2.0] System.out.println(Arrays.asList(1.0, 2.0)); // [1.0, 2.0] ``` With jnius: ```python Arrays = autoclass('java.util.Arrays') Arrays.asList([1.0, 2.0]).toString()...

https://github.com/kivy/pyjnius/blob/3371e1012873fe373773c43b556d2796d10d102e/jnius/jnius_export_class.pxi#L815-L822 https://github.com/kivy/pyjnius/blob/3371e1012873fe373773c43b556d2796d10d102e/jnius/jnius_export_class.pxi#L1079-L1087 I suspect the current behaviour may not be thread-safe, but I haven't been able to reproduce #287.

``` Arrays = autoclass("java.util.Arrays") Collectors = autoclass("java.util.stream.Collectors") #works fine #words = Arrays.asList("1", "2") #segfaults numbers = Arrays.asList(1, 2) ``` Arrays.asList() uses varargs and a generic type

Please, I have tried installing pyjnius for my project but each time I do so using the pip install command, I get the error bellow. `ERROR: Command errored out with...

Android x86, libs installed with `pip install python-for-android` pyjnius==1.2.1 ``` Python 3.8.3 (default, May 27 2020, 02:55:48) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information....

I'm trying to detect screen resolution in Kivy for Android: from kivy.utils import platform if platform == 'android': from jnius import autoclass DisplayMetrics = autoclass('android.util.DisplayMetrics') metrics = DisplayMetrics() Height_of_screen =...

MWE: ```python import sys from jnius import autoclass, PythonJavaClass, java_method class OneSupplier( PythonJavaClass ): __javainterfaces__ = [ 'java.util.function.IntSupplier' ] def __init__( self, *args, **kwargs ): super( OneSupplier, self ).__init__() @java_method('()I')...

bug

I'm new to programming and this is my first time using jnius. I intend to create an android application that makes calls to different numbers, so I decided to use...

Here is what I did after I found a Java solution. Doesn't work, there's something wrong in this code. Does anyone know what I did wrong? Thank you in advance...