kamenchunathan / kivy-android-alarm-manager-example Goto Github PK
View Code? Open in Web Editor NEWIllustrates using the android alarm manager to schedule tasks using kivy
License: MIT License
Illustrates using the android alarm manager to schedule tasks using kivy
License: MIT License
First of all thank you so much for your effort to implement android AlarmManager to Kivy. This is the only real example you can find on internet. Unfortunately i know nothing about java. I just need to wake up my app's service every hour through alarm manager when my app is not running because the service is always being killed by android system after a while even i tried sticky service. I just don't know how to trigger it every hour with this example. Is it possible? how? Thanks in advance.
Thank you very the very helpful example..
Android version is 8.0.0
I faced an issue. The notification works fine if the app is on. However, if the app is closed, I get the below error:
07-30 15:59:00.244 1193 2450 W ActivityManager: Background start not allowed: service Intent { cmp=org.test.myapp/.ServiceHandletask (has extras) } to org.test.myapp/.ServiceHandletask from pid=27087 uid=10159 pkg=org.test.myapp
07-30 15:59:00.245 27087 27087 D AndroidRuntime: Shutting down VM
07-30 15:59:00.245 1193 1193 D AlarmManager: onSendFinished begin
07-30 15:59:00.247 1193 2450 I ActivityManager: Killing 26351:com.android.providers.calendar/u0a6 (adj 906): empty #13
07-30 15:59:00.248 27087 27087 E AndroidRuntime: FATAL EXCEPTION: main
07-30 15:59:00.248 27087 27087 E AndroidRuntime: Process: org.test.myapp, PID: 27087
07-30 15:59:00.248 27087 27087 E AndroidRuntime: java.lang.RuntimeException: Unable to start receiver org.test.myapp.TaskReceiver: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=org.test.myapp/.ServiceHandletask (has extras) }: app is in background uid UidRecord{bc4b6cf u0a159 RCVR idle procs:1 seq(0,0,0)}
07-30 15:59:00.248 27087 27087 E AndroidRuntime: at android.app.ActivityThread.handleReceiver(ActivityThread.java:3364)
07-30 15:59:00.248 27087 27087 E AndroidRuntime: at android.app.ActivityThread.-wrap17(Unknown Source:0)
07-30 15:59:00.248 27087 27087 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1755)
07-30 15:59:00.248 27087 27087 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:108)
07-30 15:59:00.248 27087 27087 E AndroidRuntime: at android.os.Looper.loop(Looper.java:206)
07-30 15:59:00.248 27087 27087 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6784)
07-30 15:59:00.248 27087 27087 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
07-30 15:59:00.248 27087 27087 E AndroidRuntime: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
07-30 15:59:00.248 27087 27087 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:852)
07-30 15:59:00.248 27087 27087 E AndroidRuntime: Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=org.test.myapp/.ServiceHandletask (has extras) }: app is in background uid UidRecord{bc4b6cf u0a159 RCVR idle procs:1 seq(0,0,0)}
07-30 15:59:00.248 27087 27087 E AndroidRuntime: at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1520)
07-30 15:59:00.248 27087 27087 E AndroidRuntime: at android.app.ContextImpl.startService(ContextImpl.java:1476)
07-30 15:59:00.248 27087 27087 E AndroidRuntime: at android.content.ContextWrapper.startService(ContextWrapper.java:644)
07-30 15:59:00.248 27087 27087 E AndroidRuntime: at android.content.ContextWrapper.startService(ContextWrapper.java:644)
07-30 15:59:00.248 27087 27087 E AndroidRuntime: at org.test.myapp.ServiceHandletask.start(ServiceHandletask.java:29)
07-30 15:59:00.248 27087 27087 E AndroidRuntime: at org.test.myapp.TaskReceiver.onReceive(TaskReceiver.java:24)
07-30 15:59:00.248 27087 27087 E AndroidRuntime: at android.app.ActivityThread.handleReceiver(ActivityThread.java:3357)
07-30 15:59:00.248 27087 27087 E AndroidRuntime: ... 8 more
07-30 15:59:00.261 1193 1273 I ActivityManager: Showing crash dialog for package org.test.myapp u0
07-30 15:59:00.271 1193 1272 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver
07-30 15:59:00.271 1193 1272 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.