Skip to content

Conversation

RobertFlatt
Copy link
Contributor

An Android Service, when started, displays a service icon (in the task bar) and a notification message (in the notification shade history).

For a p4a app the icon and notification are not user configurable. The service icon is some sub region of the app launch icon, and the notification content is the service name. I characterize this as proof-of-concept functionality.

This PR overloads the service start() method with a new method having 3 extra string parameters: 'icon resource name', 'notification title', and 'notification text'. The PR applies these extra parameters, and separately we make notification channel names unique. Changes occur in the common, service_only, and service_library bootstraps.

A test case may be found here https://github.com/RobertFlatt/service_icon_test

As a side note the current p4a service implementation depends on a depreciated api, have added a comment to identify this.

Copy link
Member

@misl6 misl6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @RobertFlatt !

Thank you for such a feature! I've added a couple of comments, please let me know what do you think about it 😀

@RobertFlatt
Copy link
Contributor Author

Hey @misl6 , this work for you?

Copy link
Member

@misl6 misl6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

@misl6 misl6 merged commit 8cb497d into kivy:develop Dec 9, 2022
shyamnathp pushed a commit to shyamnathp/python-for-android that referenced this pull request Feb 17, 2023
* add_resources

* add_resource

* Update build.py

* stateless

* multiple kinds

* pep8

* --add_resource

* Custom notification

* Update Service.tmpl.java

* Custom Notification

* Custom Notification

* service notification

* customize notification

* share code

* share code

* Update Service.tmpl.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants