Questions tagged [pyjnius]

Pyjnius is a Python library for accessing Java classes.

Pyjnius is a library for accessing classes.

References:

170 questions
1
vote
1 answer

Implement Java interface from Python using PyJnius

Is there a way to implement Java interface from Python, for example this OnPreparedListener interface? I've tried Pyjinius but not successful.
taichan
  • 36
  • 6
1
vote
1 answer

pyjnius java abstract class implementation

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…
1
vote
1 answer

First qpython jnius example not working?

I am trying to test pyjnius in the qpython console on Android. My first line: from jnius import autoclass fails in console with SystemError: NULL result without error in PyObject_Call Any suggestions or am I missing something? (I tested this on…
skvery
  • 336
  • 2
  • 16
1
vote
2 answers

Android App to check if wifi is enabled or not

I've been trying to create an Android app to check if the phone's wifi is turned on or off. What I'm trying to do is, if the WiFi is on, then is shows a BoxLayout which is white in color and if it isn't on, then it shows a Popup. I'm new to Android…
Parthib Biswas
  • 471
  • 1
  • 7
  • 17
1
vote
1 answer

Python with Java, PyJNIus installation

In order to use Java with bindings in Python, am installing, the following: https://github.com/kivy/pyjnius I got this error: it seems trying to compile C++ file header into the Java_HOME.... , which looks very strange: Installing collected…
user5497885
1
vote
1 answer

How to properly access an Android java class using Pyjnius

I am having a hard time trying to use Pyjnius to access a Android Java class "ContactsContract.Intents.Insert". I have been following this example provided here: Pyjnius:…
Edwinner
  • 2,458
  • 1
  • 22
  • 33
1
vote
0 answers

Java annotation using Pyjnius

I copied this code to use android native WebView in my Kivy application. Works perfectly :) Now, I would like to bind my JavaScript with my Kivy application. I've read through this guide: ... /** Show a toast from the web page…
Michael
  • 3,206
  • 5
  • 26
  • 44
1
vote
1 answer

Launching android player from kivy

I am trying to launch media player to play an HLS link from kivy+android environment. I am able to launch the default media player using the sample code I got from net (given below). But I have installed another better media player…
user2148707
  • 93
  • 12
1
vote
1 answer

Installing pyjnius on Windows

I need to access the bluetooth on Android in my Kivy app. I am trying to setup pyjnius on Windows for developing my app. I downloaded pyjnius from GitHub and tried to setup it up for python in the kivy folder. Following the setup, I tried to run…
siva82kb
  • 1,910
  • 4
  • 19
  • 28
0
votes
0 answers

Pyjnius error while making an app that connects to wifi programitically in android python

jnius.jnius.JavaException: Cannot call instance method b'addNetwork' on class b'android/net/wifi/WifiManager' 3.443 24111 24278 I python : File "kivy/_event.pyx", line 727, in kivy._event.EventDispatcher.dispatch 08-29 12:22:43.443 24111 24278 I…
0
votes
0 answers

Pyjnius : User of init() function belonging to Cipher class

I am using pyjnius and have installed Java version 17.0.6 on my ubuntu running on an Raspberry pi 400. Using Python 3.11 and Cython 0.29 is installed. I am running the following code - Cipher = autoclass('javax.crypto.Cipher') cipher =…
Mrudula Y
  • 1
  • 2
0
votes
0 answers

No sound when using android audiotrack on kivy app

I'm creating android app that receive on socket decoded mp3 music from python server. When I try to play back the music received in the stream using the pyjnius library and android audiotrack there is absolutely no sound on the phone. Сlient on…
Venjer
  • 1
  • 1
0
votes
0 answers

Kivy app crash on Android with jnius error

I wrote a small application using Python Kivy on a PC, it works fine, but on Android it crashes with this error: 05-02 12:54:26.906 9978 10018 F org.test.myapp: runtime.cc:655\] native: #10 pc 000401c1…
0
votes
0 answers

Cannot make java object from python using pyjnius

I'm trying to get rewarded ads to work on kivy using pyjnius by following the example by google (https://github.com/googleads/googleads-mobile-android-examples/tree/main/java/admob/RewardedVideoExample) to create a loadRewardedAd function and a…
alex10791
  • 434
  • 4
  • 11
0
votes
0 answers

pyjnius correct class access to make a fullscreen kivy app

I need your help. How I can correctly access to "setDecorFitsSystemWindows" and "layoutInDisplayCutoutMode"? FLAG_KEEP_SCREEN_ON is working, so I assume flags are not my issue. I think subclasses access is the problem. from kivy.utils import…
CikoXp
  • 11
  • 4