Search code examples
androidandroid-intentkivyalarmmanagerpyjnius

Run my python code of kivy app at given time


I have made an basic app when the user selects any random number between 0-99 , and at sharp 8 pm, this app randoo selects one number between 0-99. If the randomly updated number matches with user's selected number then that user is the winner.

I have defined one class, which says that , if time ==8pm then connect to database and check whoever have selected the number which matches to randomly generated number. If there exists any, then update their name to another table.

But the problem is, atleast one user should open my app at sharp 8pm. If no one opens my app at 8pm, then the table won't be updated.

I want my python code to run at Sharp 8pm on Android. I have heard of AlarmManager ,but don't know how to implement it in Python.

How can I solve this issue?

If there are other methods than AlarmManager also, help me out.


Solution

  • We can do it using Wayscript. Wayscript helps to trigger any python function. Create a python file in way script website and set triggering time exactly at 8pm daily.

    This worked for me.