plyer icon indicating copy to clipboard operation
plyer copied to clipboard

Address LocationListener java method added with API31

Open HyTurtle opened this issue 2 years ago • 2 comments

For reference: LocationListener

Is there another way you'd handle this List/make use of the OnLocationChanged?

HyTurtle avatar Feb 11 '22 17:02 HyTurtle

closes #657

suppose onFlushComplete should be added as well in this PR

HyTurtle avatar Feb 12 '22 19:02 HyTurtle

For reference: LocationListener

Is there another way you'd handle this List/make use of the OnLocationChanged?

there might be apps that want to trace the path of the device as precisely as possible, and would rather have all the intermediate points? Maybe we could let the user decide which scenario they want to handle, either through a flag, or through a separate event.

tshirtman avatar Aug 28 '22 23:08 tshirtman

For me it seems ok, better than plyer breaking on API 31. We are at least sync with previous implementation.

For the record, even targetting with SDK 30, this new method got triggered.

❯ aapt list -a build/bin/lillefives1942-0.9.0-armeabi-v7a-debug.apk|grep SdkVersion
    A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1e
    A: android:compileSdkVersionCodename(0x01010573)="11" (Raw: "11")
      A: android:minSdkVersion(0x0101020c)=(type 0x10)0x15
      A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1e
03-15 19:43:54.477 30534 30534 I python  : ===== Python/java method missing ======
03-15 19:43:54.477 30534 30534 I python  : Python class:<plyer.platforms.android.gps._LocationListener object at 0xaed0e868>
03-15 19:43:54.477 30534 30534 I python  : Java method name:onLocationChanged
03-15 19:43:54.477 30534 30534 I python  : Signature: (Ljava/util/List;)V
03-15 19:43:54.477 30534 30534 I python  : =======================================
03-15 19:43:54.477 30534 30534 I python  : 
03-15 19:43:54.480 30534 30534 I python  :  Traceback (most recent call last):
03-15 19:43:54.480 30534 30534 I python  :    File "jnius/jnius_proxy.pxi", line 50, in jnius.jnius.PythonJavaClass.invoke
03-15 19:43:54.480 30534 30534 I python  :    File "jnius/jnius_proxy.pxi", line 74, in jnius.jnius.PythonJavaClass._invoke
03-15 19:43:54.480 30534 30534 I python  :  NotImplementedError: The method ('onLocationChanged', ('V', ('Ljava/util/List;',))) is not implemented

I am accepting this.

tito avatar Mar 15 '23 18:03 tito