Android Question JavaObject not works in Android 14

Sinan Tuzcu

Well-Known Member
Licensed User
Longtime User
Hi,

Hello,

My app works perfectly on Android version 9 and older. However, starting from version 14, an issue occurs that causes the app to crash.

I would appreciate support in solving this problem.

B4X:
Dim socket As JavaObject = r.GetField("socket")
Dim jo As JavaObject = Me
 jo.RunMethod("setKeepaliveSocketOptions", Array(socket, 1000, 1000, 3))


I didn’t have any problems with this on Android 9.
 

aeric

Expert
Licensed User
Longtime User
I suggest you share the error message that you get.
Can it be changes in protocol?
 
Upvote 0

Sinan Tuzcu

Well-Known Member
Licensed User
Longtime User
"Is there a way to modify this code so that it also runs on Android 14?"

B4X:
Dim r As Reflector
    r.Target = Socket1
    Dim socket As JavaObject = r.GetField("socket")
    Dim jo As JavaObject = Me
    jo.RunMethod("setKeepaliveSocketOptions", Array(socket, 1000, 1000, 3))
 
Upvote 0

Sinan Tuzcu

Well-Known Member
Licensed User
Longtime User
Error MSG

 
Upvote 0

Sinan Tuzcu

Well-Known Member
Licensed User
Longtime User
This

B4X:
Dim r As Reflector
    r.Target = Socket1
    Dim socket As JavaObject = r.GetField("socket")
    Dim jo As JavaObject = Me
    jo.RunMethod("setKeepaliveSocketOptions", Array(socket, 1000, 1000, 3))


And this one:
B4X:
Service.StartForeground(1,Notification1)

and this one
B4X:
StartService(Winsock)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…