Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid app lifetime: maybe it infinite?
    primarykey
    data
    text
    <p>I'm developing an app designed to transform an android phone into a remote device running without user action. At the time the app is made by an Activity that sets AlarmManager to execute a service (class inside project) every X minutes.</p> <p>All this works OK, but occasionally <strong>after 5-6 DAYS continuosly running</strong> the application crashes (currently I don't know why, because i can't get the phone now). It isn't a connection problem (I know) and the phone is still running (plugged into AC). The only thing that i can suppose is that the application is down.</p> <p>I don't think that this is due to a bug, because the prew debugging doesn't give me any errors.</p> <p>So I must suppose that android has killed the activity (system needs more memory?) and as the image explain there is no way to back it up. </p> <p><img src="https://i.stack.imgur.com/1KbGb.png" alt="Flow diagram"></p> <p>But I have a doubt: in my application the activity doesn't matter, because all the work is done by the service. The service itself is called by an Alarm Manager and in the time between two calls the service is terminated by StopSelf().</p> <p>In my case the system may kill my alarm manager service schedule? </p> <p><strong>What can I do to have the service start up by Alarm Manager forever?</strong> </p> <p>(<em>ATTENTION</em>: currently there is yet a WAKE LOCK but this consider only the execution of the service! I hope that you have understand that the service is called each x minutes by alarm manager and than terminated...i want to perform this operations for an indefinite time) </p> <p>[I haven't posted the source code because is too long]</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload