Note that there are some explanatory texts on larger screens.

plurals
  1. POTitanium mobile application crashes after a period in the background (including services)
    primarykey
    data
    text
    <p><strong>As reference, this is on Android, and this is the <a href="http://developer.appcelerator.com/question/156480/application-crashes-after-a-period-in-the-background-including-services" rel="nofollow">Titanium Forum Post</a></strong></p> <p>I'm noticing this issue with several applications I've done with Appcelerator, all of them: no matter if they are simple apps or complex apps, but is more frequent in larger apps.</p> <p>For example, I'm working on an application that needs to notify its location (GPS location) every 5 minutes. The application works perfectly when working in foreground, however, every time I put the app on the background (if I minimize the app by using the Home button) the application just crashes and all the services are stopped.</p> <p><strong>For notifying the application, here's the flow I'm using:</strong></p> <ol> <li>When I start the application, I start an Alarm, using the <a href="https://github.com/benbahrenburg/benCoding.AlarmManager" rel="nofollow">AlarmManager module</a>.</li> <li>This AlarmManager, adds a new Alarm Service, which will be triggered every 5 minutes.</li> <li>Every 5 minutes, the AlarmManager starts the service and notifies the server with the current location.</li> </ol> <p><strong>This works great.</strong></p> <p>If I hit the "Home" button, the application just crashes (on the Application Manager) sometimes, but is more frequent when using other applications on the foreground while leaving this app on the background.</p> <p>I thought this was because the main Activity was stopped, so I decided to maintain the main activity / task state by using <code>android:alwaysRetainTaskState="true"</code></p> <p>If I reopen the application, the application just restarts. This happens more on low-end devices than on high-end devices, which makes me think that this is a memory issue.</p> <p><strong>I have some questions:</strong></p> <ol> <li>Is this the expected behaviour?</li> <li>If so, how can I mitigate this (maybe a native module/service?)?</li> <li>Is my current flow the best flow for doing this or is there a better approach?</li> </ol> <p>Any thoughts are more than appreciated.</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.
    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