android_notify icon indicating copy to clipboard operation
android_notify copied to clipboard

simplify broadcast listener for service

Open Fector101 opened this issue 1 month ago • 4 comments

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

Fector101 avatar Oct 13 '26 21:10 Fector101

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

Fector101 avatar Oct 18 '26 15:10 Fector101

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

Fector101 avatar Oct 19 '26 21:10 Fector101

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

Fector101 avatar Oct 21 '26 12:10 Fector101

I've been merged on P4a repo, on to the next phase

  • new APIs or internal changes
  • and changes to docs

Fector101 avatar Oct 27 '26 22:10 Fector101