Weird android system behavior if application is running more than ~8 hours

  • Antworten:7
ninodor
  • Forum-Beiträge: 3

02.02.2021, 08:03:52 via Website

im currently building a digital signage app, which is running on displays which are based on android 7.*. Everything is working perfectly, except a weird OS behavior:

After a while (6-9h) of running the app, android minimizes my application, i don't get any error logs nor do i get a exception thrown.

My workaround solution is that im reopening the app every 2 hours, this is working fine, but its not what it should be.

I already tried it with WakeLock, Keep alive, Kiosk Mode, nothing seems to be working.

Does anyone have a idea how i could solve this android behavior?

I am getting pretty frustratet. PLS help :)

Kommentieren
Rafael K.
  • Forum-Beiträge: 2.359

02.02.2021, 08:24:12 via Website

Hi,

so what you're saying is, the app runs in foreground all the time and then automatically minimizes, but does not get killed? Are you sure about that second part?
I've never heard of a runtime constraint where Android would minimize apps, but could imagine situations, when apps run out of memory or so after a long time of operation - and thus get killed.
For example when they update data constantly and hold everything in memory.

Regards
Rafael

Hilfreich?
Kommentieren
ninodor
  • Forum-Beiträge: 3

02.02.2021, 08:32:19 via Website

Hi Rafael,
Yes i am sorry. It gets killed after X amount of time.
The app just sends all 3-5 Minutes a http request to check for new content etc.

Any idea?

Hilfreich?
Kommentieren
Jokel
  • Forum-Beiträge: 1.529

02.02.2021, 10:46:09 via Website

Hello Question what kind of background service do you use? With Android 7 you could also use the alarm manager that works with Android 7.

Bitte Scheibe in deutsch das ist ein deutsches forum.

Hilfreich?
Pascal P.
Kommentieren
ninodor
  • Forum-Beiträge: 3

02.02.2021, 10:49:20 via Website

Servus Jokel,

Verstanden.

Ja wir verwenden bereits den alarm manager. Hat uns auch nicht weitergeholfen.

Lg

Hilfreich?
Kommentieren
Jokel
  • Forum-Beiträge: 1.529

02.02.2021, 10:58:36 via Website

Der alarm soll nur dazu dienen service zu beenden und neu zustarten.
Natürlich braucht das, auch etwas Zeit beenden und Neustart.

Ich würde wohl auch einen Vordergrund service mit Notification nutzen.

— geändert am 02.02.2021, 14:01:08

Hilfreich?
Kommentieren
Rafael K.
  • Forum-Beiträge: 2.359

02.02.2021, 12:41:54 via Website

Nochmal die Frage:
Ist die App wirklich im Vordergrund zu sehen und wird dann von Android minimiert/beendet?
Dann würde ich mich darauf fokussieren.
Vermutlich läuft irgendwann in einen OutOfMemoryError o.ä. und crashed.
Ich glaube nicht, dass Android eine App im Vordergrund einfach so beendet.

Dann macht es nämlich keinen Unterscheid, ob man AlarmManager, WorkManager, ForegroundNotification verwendet.

— geändert am 02.02.2021, 12:43:10

Hilfreich?
Jokel
Kommentieren
Jokel
  • Forum-Beiträge: 1.529

02.02.2021, 13:58:10 via Website

Ja, wichtig ist zu wissen ob dein http request denn du alle 5 min schickst in einer activity oder einem service läuft und wenn service dann welcher genau?

Wie mit was macht oder versucht ihr einen hardbeat zu erzeugen. Um den eventuellen Service am Leben zuerhalten?

Genauere Angaben bitte.

Hilfreich?
Kommentieren