How do I open the kivy app automatically?

46 views
Skip to first unread message

ТН Н

unread,
Jan 23, 2021, 8:13:41 AM1/23/21
to Kivy users support
I have a script running in the thread that waits for the time specified by the user. How do I launch the app when the time is right? For some reason, I can't even change the screen via sm.current = 'name'. It doesn't work in a thread, but it works without a thread.

Elliot Garbus

unread,
Jan 23, 2021, 9:11:34 AM1/23/21
to kivy-...@googlegroups.com

I don’t understand what you are trying to do.

Can you use Clock.schedule_once() to set the wait, rather that a wait in another thread?

 

When you say launch the app, do you mean call AppName().run()?

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/06abed47-76ab-4e79-b120-7b763c65bff7o%40googlegroups.com.

 

ТН Н

unread,
Jan 23, 2021, 9:21:46 AM1/23/21
to Kivy users support
Sorry for the inaccurate question. My application will always run in the background and I need to expand it, and not the start screen, but another one.

суббота, 23 января 2021 г., 17:11:34 UTC+3 пользователь ElliotG написал:

I don’t understand what you are trying to do.

Can you use Clock.schedule_once() to set the wait, rather that a wait in another thread?

 

When you say launch the app, do you mean call AppName().run()?

 

From: ТН Н
Sent: Saturday, January 23, 2021 6:13 AM
To: Kivy users support
Subject: [kivy-users] How do I open the kivy app automatically?

 

I have a script running in the thread that waits for the time specified by the user. How do I launch the app when the time is right? For some reason, I can't even change the screen via sm.current = 'name'. It doesn't work in a thread, but it works without a thread.

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.

To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.

ТН Н

unread,
Jan 23, 2021, 9:27:37 AM1/23/21
to Kivy users support
I could use Clock.schedule_once () if it doesn't interfere with using the app after setting the time, but the problem is that I don't understand how to calculate the time if the user sets it at the end of the week. I'm writing a reminder, so the app should always run in the background in the thread and wait for the right time.


суббота, 23 января 2021 г., 17:11:34 UTC+3 пользователь ElliotG написал:

I don’t understand what you are trying to do.

Can you use Clock.schedule_once() to set the wait, rather that a wait in another thread?

 

When you say launch the app, do you mean call AppName().run()?

 

From: ТН Н
Sent: Saturday, January 23, 2021 6:13 AM
To: Kivy users support
Subject: [kivy-users] How do I open the kivy app automatically?

 

I have a script running in the thread that waits for the time specified by the user. How do I launch the app when the time is right? For some reason, I can't even change the screen via sm.current = 'name'. It doesn't work in a thread, but it works without a thread.

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.

To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.

Elliot Garbus

unread,
Jan 23, 2021, 10:04:12 AM1/23/21
to kivy-...@googlegroups.com

Clock.schedule_once will not interfere with the operation of the app.  You are simply scheduling an event to happen in the future.

 

In the  datatime module you can use timedelta to convert differences between dates/time into seconds.  You need seconds for the Clock methods.

To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/c7bb757d-f16f-49fd-acf0-a75132ddb480o%40googlegroups.com.

 

ТН Н

unread,
Jan 23, 2021, 11:22:37 AM1/23/21
to Kivy users support
OK, thank you, but how do I deploy the app? That was my original question.

суббота, 23 января 2021 г., 18:04:12 UTC+3 пользователь ElliotG написал:

Elliot Garbus

unread,
Jan 23, 2021, 11:32:42 AM1/23/21
to kivy-...@googlegroups.com

I’m sorry I don’t understand – deploy the app?

To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/d88f7966-caa3-49ef-83f1-fa8440df8519o%40googlegroups.com.

 

ТН Н

unread,
Jan 23, 2021, 12:16:38 PM1/23/21
to Kivy users support
The app runs in the background. I need to deploy the application, open the interface. I don't understand why my question is not clear. Language barrier? I need to open its interface with a reminder screen when the time comes, how?

суббота, 23 января 2021 г., 19:32:42 UTC+3 пользователь ElliotG написал:

Elliot Garbus

unread,
Jan 23, 2021, 12:45:28 PM1/23/21
to kivy-...@googlegroups.com

Deploy the app – are you asking how to package the app and distribute to users?

 

App runs in background… Desktop (Windows, Mac, Linux) or Mobile(Android/IOS)?

 

I would assume the app runs – and remains running you use a screen to set the ‘wake up’ time.  The user minimizes the app, and at wake up time the app maximizes the window (assumes desktop).

 

Alternatively  - again assuming a desktop app – you could look for other scheduler programs that your could use the start your app.  For example:

https://datatofish.com/python-script-windows-scheduler/

There are also python packages that schedule running apps – but I don’t know what you are trying to do – or what platform you are running on.

To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/d1dfcf82-7477-4f94-8686-98b2d06a3e9bo%40googlegroups.com.

 

ТН Н

unread,
Jan 23, 2021, 12:51:38 PM1/23/21
to Kivy users support
Yes, you misunderstood me, I used the wrong word.The user minimizes the app, and at wake up time the app maximizes the window (Its own kivy window with the information that the user specified. That is, I will not specify the start window of the application). The task may be complicated by what I do on linux/windows, but the ultimate goal is android.

суббота, 23 января 2021 г., 20:45:28 UTC+3 пользователь ElliotG написал:

Elliot Garbus

unread,
Jan 23, 2021, 1:23:48 PM1/23/21
to kivy-...@googlegroups.com

On Android, I suspect you will either need to use and existing Android API for scheduling an app – or create a service that will run in the background.  I have not done any coding on Android.

A quick google search suggests you will want to use: https://developer.android.com/reference/android/app/AlarmManager

To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/459e7ed0-d223-456b-b2af-470ada5188d9o%40googlegroups.com.

 

Message has been deleted

ТН Н

unread,
Jan 23, 2021, 1:56:48 PM1/23/21
to Kivy users support
Oh, man, I told you I have a script written for a long time that works properly, I just need to maximize the application when it works. Yes, I can use Clock.schedule_once () or the Android API or https://developer.android.com/reference/android/app/AlarmManager to get rid of using the stream, but why?

суббота, 23 января 2021 г., 21:23:48 UTC+3 пользователь ElliotG написал:

Elliot Garbus

unread,
Jan 23, 2021, 2:15:57 PM1/23/21
to kivy-...@googlegroups.com

If you want to maximize a window… on a desktop:  https://kivy.org/doc/stable/api-kivy.core.window.html?highlight=window%20maximize#kivy.core.window.WindowBase.maximize

 

from kivy.core.window import Window

 

Window.maximize()

 

On android, I assume the app will not be visible and the AlarmManager will cause the app to resume – but I’m not an Android guy.

To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/d73bc3c5-5f89-4c28-b6f7-913c476ae0efo%40googlegroups.com.

 

ТН Н

unread,
Jan 23, 2021, 3:23:38 PM1/23/21
to Kivy users support
Thank you very much.

суббота, 23 января 2021 г., 22:15:57 UTC+3 пользователь ElliotG написал:

ТН Н

unread,
Feb 5, 2021, 7:24:19 AM2/5/21
to Kivy users support
Dear EliotG, it turned out that Window.maximize() is not what I need. It expand the app to full screen, the user still needs to open the app manually. I need that if the application is minimized, then it is unfold.


суббота, 23 января 2021 г., 22:15:57 UTC+3 пользователь ElliotG написал:

Elliot Garbus

unread,
Feb 6, 2021, 11:59:00 AM2/6/21
to kivy-...@googlegroups.com

Here is a small example that restores the window 3 seconds after the window has been minimized.

 

from kivy.app import App
from kivy.lang import Builder
from kivy.core.window import Window
from kivy.clock import Clock

kv=
"""
BoxLayout:
    Button:
        text: 'Minimize the Window'
        on_release: app.min_win()
"""


class MinRestoreApp(App):
   
def build(self):
        Window.bind(
on_minimize=self.restore_win_delayed)
       
return Builder.load_string(kv)

   
def min_win(self):
        Window.minimize()
        Clock.schedule_once(
self.restore_win, 3)

   
def restore_win_delayed(self, *args):
        Clock.schedule_once(
self.restore_win, 3)

   
def restore_win(self, *args):
        Window.restore()

MinRestoreApp().run()

To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/4ddb5a59-c294-4f4e-9de5-0531ed99b3ebo%40googlegroups.com.

 

ТН Н

unread,
Feb 6, 2021, 12:59:31 PM2/6/21
to Kivy users support
Thank you, you shouldn't have bothered to write an example, it was enough to mention the restore () method.

суббота, 6 февраля 2021 г., 19:59:00 UTC+3 пользователь ElliotG написал:
Reply all
Reply to author
Forward
0 new messages