simplify broadcast listener for service
idea
from android_notify import Notification
from android_notify.broadcast import BroadcastListener
class WallpaperListener(BroadcastListener):
def on_action(self, action):
if action == "skip":
print("Skipping wallpaper")
elif action == "stop":
print("Stopping carousel")
listener = WallpaperListener()
notification = Notification(title="Wallpaper Carousel")
notification.addButton(
text="Skip",
action="skip",
listener=listener,
)
notification.addButton(
text="Stop",
action="stop",
listener=listener,
)
https://github.com/Fector101/android_notify/wiki/Routing-Broadcast-listener-to-Python
test kivy broadcast receiver, maybe the receiver in the AndroidMainfest.xml will be something like GenericBroadcastReciever
https://python-for-android.readthedocs.io/en/latest/apis.html
kivy version(dynamic broadcast receiver in android) worked after some patches
tho my app is currently crashing with "isn't compatible with current version of Android"
This maybe a step towards having callback feature available for Flet python
tho my app is currently crashing with "isn't compatible with current version of Android"
it was because old reciever was still in android mainfest xml
I've been merged on P4a repo, on to the next phase
- new APIs or internal changes
- and changes to docs