-
Notifications
You must be signed in to change notification settings - Fork 427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notification is not working in android #93
Comments
Thanks @afreport for the report. Could you also attach the logs you get from logcat? |
*** RUN 'Plyer Notification Example' *** V/python ( 1776): metadata fullscreen is0 *** NOTHING. I JUST PRESS ENTER IN TERMINAL *** I/python ( 1776): [INFO ] [Base ] Leaving application in progress... |
Thanks a lot @afreport. The problem is indeed with the android notification facade implementation. I haven't had a chance yet to look into the source - https://github.com/kivy/plyer/commits/master/plyer/platforms/android/notification.py. |
Ping @brousch ? |
What's your buildozer.spec look like? I'm specifically wondering about the android.api, android.minapi, android.sdk, and android.ndk settings. I have had success using: |
I tried with
and then with:
Still the same error:
Using plyer APIs on Linux work but on android it fails. I tried notification and got the same result (working on Linux and crushing the app on android). Any update on this issue? |
Same error with same log message under Kivy launcher |
Could it be that plyer in recent releases or a specific combination of android ndk, sdk and plyer don't work? Any insights on this from the kivy team? |
When I looked at it briefly a few weeks ago it seemed to only be broken on
|
I've tested this on android 4.2.1 and 4.03 and it's broken on both. Any ideas on where the problem may be in Plyer? If it's python code then I can try to get it working and then submit a pull request. |
Android code in plyer just seems plain broken and redundant (.build is called twice?). I think it also grabs the wrong activity when you're trying to call it from PythonService. In addition, plyer works poorly with pyinstaller, has a major pain-in-the-butt dynamic loader that prevents it from manual inclusion. Altogether, just seems ill-written from the beginning. Today I pulled Android code out of plyer and run it manually within my PythonService like so: from jnius import autoclass def nt(title, msg): |
@vigilantzealot Can you point out the issues with current plyer code? I can try updating it and then have a pull request ready for the kivy team if that's ok with the team? |
That would be great. Thanks! On Wed, Nov 12, 2014 at 10:27 AM, Kashif Iftikhar [email protected]
|
@kashifpk sure. are you plyer project leader? i can send what i have on windows/android once i am done with the implementation. the biggest problem with plyer is its dynamic import statement. It needs to use plain inheritance and leave hooks for extension - really basic one-class inheritance. That would make the code portable, easy to use. private-send me your email, i can get back to you with in a week or two. |
@vigilantzealot No I'm not yet involved with plyer or kivy for that matter. I myself was facing the same issues with plyer. Since it seems that kivy team members are busy focusing on other aspects of the framework (probably for the upcoming release) and this issue has been open for more than a couple of months; I thought I could contribute to it. You can contact me at: kashif [at] compulife.com.pk |
cool, i'll contact you with what i have soon. i am basically rewriting plyer for myself due to annoyances like inability to add maximize window function when notification is clicked (no easy way to patch it in either). For windows, I am using SysTrayIcon.py by Simon as base - it also has capability to make a basic menu. |
The Kivy team would love to see your ideas about Plyer improvements. The On Wed, Nov 12, 2014 at 1:37 PM, vigilantzealot [email protected]
Ben Rousch |
Don't know if it helps but commenting out the following code
at https://github.com/kivy/plyer/blob/master/plyer/platforms/android/notification.py#L27 made the notifications work again. I'm ignoring the SDK version here but not calling any of the methods ( build() or getNotification() ) and having it work suggests that this code can be ignored? |
You'll see a little bit below those lines noti.build() is called again (not needed). remove ".build()" there |
@vigilantzealot thanks, followed your advice and it's fixed. |
Linux (ubuntu 14.04)
Android 4.0.4 (Samsung GALAXY Note)
$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
$ pip freeze
Kivy==1.8.0
Kivy-Garden==0.1.1
plyer==1.1.2
pyjnius==1.3.0
buildozer==0.15
Cython==0.20.2
PyOpenGL==3.0.2
pyOpenSSL==0.13
pygame==1.9.1release
The text was updated successfully, but these errors were encountered: