You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code works on mac, but on an Android device it seems that the service and main app don't exchange (respond to) messages from one another.
Because if I don't send messages between them and just start service and push notification on a time interval it works.
Below is my code.
from time import sleep
from oscpy.server import OSCThreadServer
from oscpy.client import OSCClient
from plyer import notification
from plyer.utils import platform
from jnius import autoclass
CLIENT = OSCClient(address='localhost', port=3002)
def push_up():
if platform == 'android':
notification.notify(title='Test', message='This is a test message')
else:
print('Service works')
def ping_activity():
CLIENT.send_message(b'/ping_response', [])
if __name__ == '__main__':
SERVER = OSCThreadServer()
SERVER.listen(address='localhost', port=3000, default=True)
SERVER.bind(b'/push_up', push_up)
PythonService = autoclass('org.kivy.android.PythonService')
PythonService.mService.setAutoRestartService(True)
while True:
sleep(10)
ping_activity()
Expected behaviour is for service to ping the main app on a specific time interval, then get a response (with some data in the future) and to push a notification with plyer.
logcat shows no errors.
Many thanks in advance!
The text was updated successfully, but these errors were encountered:
Sorry for not seeing this earlier, did you succeed? if not, did you try adding the INTERNET permission to your app in buildozer.spec or through p4a command line options?
Sorry for not seeing this earlier, did you succeed? if not, did you try adding the INTERNET permission to your app in buildozer.spec or through p4a command line options?
Yeah, I had the INTERNET permission in my buildozer.spec. I've kinda found a workaround for my project, I just launch the service from the main app, but don't exchange any data between them
The code works on mac, but on an Android device it seems that the service and main app don't exchange (respond to) messages from one another.
Because if I don't send messages between them and just start service and push notification on a time interval it works.
Below is my code.
main.py:
And here's the service code:
Expected behaviour is for service to ping the main app on a specific time interval, then get a response (with some data in the future) and to push a notification with plyer.
logcat shows no errors.
Many thanks in advance!
The text was updated successfully, but these errors were encountered: