{"repo":"kivy/pyjnius","free":true,"listed":false,"github":"https://github.com/kivy/pyjnius","clone":"git clone https://github.com/kivy/pyjnius.git","description":"Access Java classes from Python","language":"Python","stars":1480,"topics":["python","java","jni","jni-android","jni-wrapper"],"license":"MIT","category":"mobile-apps","readme_excerpt":"PyJNIus ======= PyJNIus is a Python library for accessing Java classes using the Java Native Interface (JNI). PyJNIus is managed by the Kivy Team and can be used with python-for-android. It can also be used independently of Kivy, on desktop and mobile platforms. [!WARNING] The PyPI package name is now pyjnius instead of jnius . /badge.svg) Installation ------------ Quick overview -------------- Usage with python-for-android ----------------------------- Get python-for-android Compile a distribution with kivy (PyJNIus will be automatically added) Then, you can do this kind of thing: It will output something like: Advanced example ---------------- When you use autoclass , it will discover all the methods and fields of the class and resolve them. You may want to declare and use only what you need. The previous example can be done manually as follows: You can use the signatures method of JavaMethod and JavaMultipleMethod , to inspect the discovered signatures of a method of an object Each pair contains the list of accepted arguments types, and the returned type. Troubleshooting --------------- Make sure a Java Development Kit (JDK) is installed on your operating system if you want to use PyJNIus on desktop. OpenJDK is known to work, and the Oracle Java JDK should work as well. On Windows, make sure JAVA HOME points to your Java installation, so PyJNIus can locate the jvm.dll file allowing it to start Java. This shouldn't be necessary on macOS and Linux, but in case PyJNIus fails ","default_branch":null,"files":null,"tree":[],"storefront":"/r/kivy","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/kivy/pyjnius/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}