Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: app got terminated when its goes to background on Android 7 and above


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 4 - Last Post: Feb 18, 2018 11:13 AM Last Post By: Guest
madammar ellias

Posts: 111
Registered: 8/17/17
app got terminated when its goes to background on Android 7 and above  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 9, 2018 6:43 AM
i have build an app with seattle its just an empty app then i have tested it on my S8 device to test some background/foreground issues on certain device

it seems like any time the app goes to background it got killed is this a problem with firemonkey ? i did not test this on tokyo yet any one else face this problem ?
Lajos Juhasz

Posts: 801
Registered: 3/14/14
Re: app got terminated when its goes to background on Android 7 and above  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 9, 2018 8:31 AM   in response to: madammar ellias in response to: madammar ellias
madammar ellias wrote:

i have build an app with seattle its just an empty app then i have
tested it on my S8 device to test some background/foreground issues
on certain device

it seems like any time the app goes to background it got killed is
this a problem with firemonkey ? i did not test this on tokyo yet any
one else face this problem ?

You should downgrade the android on your device ;) It's most probably a
feature of Android. A quick google returned this link:

http://www.androidbeat.com/2017/03/how-to-stop-android-apps-killed-marshmallow-nougat/
madammar ellias

Posts: 111
Registered: 8/17/17
Re: app got terminated when its goes to background on Android 7 and above  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 9, 2018 10:22 AM   in response to: Lajos Juhasz in response to: Lajos Juhasz
Lajos Juhasz wrote:

You should downgrade the android on your device ;) It's most probably a
feature of Android. A quick google returned this link:

http://www.androidbeat.com/2017/03/how-to-stop-android-apps-killed-marshmallow-nougat/

this is not caused by battery consumption . down grade android device to make a firemonkey app works is simply a joke .
Guest
Re: app got terminated when its goes to background on Android 7 and above
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 10, 2018 9:26 PM   in response to: madammar ellias in response to: madammar ellias
madammar ellias wrote:
i have build an app with seattle its just an empty app then i have tested it on my S8 device to test some background/foreground issues on certain device

it seems like any time the app goes to background it got killed is this a problem with firemonkey ? i did not test this on tokyo yet any one else face this problem ?

Android has gone quite aggressive in its later versions regarding any App which is not in the foreground. Generally it will kill it within 10 minutes or so.
If you want to do any background work, you MUST use a Service, and even then there are situations where even the Service will be killed of if Android feels like it. You can set the Service to be "sticky" which will cause it to be restarted by Android at such a time.

This is not a beginners programming job. I have spend 2 months on it already and still have problems with the Service.

https://developer.android.com/guide/components/services.html

Bart
--
Bart Kindt, CEO and developer
SARTrack Limited New Zealand
http://www.sartrack.co.nz/

Edited by: Bart Kindt on Jan 11, 2018 6:30 PM
Guest
Re: app got terminated when its goes to background on Android 7 and above
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 18, 2018 11:12 AM   in response to: Guest in response to: Guest
Guest wrote:
madammar ellias wrote:
i have build an app with seattle its just an empty app then i have tested it on my S8 device to test some background/foreground issues on certain device

it seems like any time the app goes to background it got killed is this a problem with firemonkey ? i did not test this on tokyo yet any one else face this problem ?

Android has gone quite aggressive in its later versions regarding any App which is not in the foreground. Generally it will kill it within 10 minutes or so.
If you want to do any background work, you MUST use a Service, and even then there are situations where even the Service will be killed of if Android feels like it. You can set the Service to be "sticky" which will cause it to be restarted by Android at such a time.

This is not a beginners programming job. I have spend 2 months on it already and still have problems with the Service.

https://developer.android.com/guide/components/services.html

Bart
--
Bart Kindt, CEO and developer
SARTrack Limited New Zealand
http://www.sartrack.co.nz/

Edited by: Bart Kindt on Jan 11, 2018 6:30 PM

I've wrote a Local foreground Service for my Android Streaming App that is on Google Play.

You can find the information here:

Detailed instructions in the Readme.md file here: https://github.com/War3Evo/FMX.Radio

The Google Play application plaStreamer: https://github.com/War3Evo/FMX.Radio/tree/master/AndroidServiceRadioSampleApplication

Hope that helps!

Edited by: Gregory Timmons on Feb 18, 2018 11:13 AM
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02