I have an issue with appcelerator related to android support service. The service starts, and when I click the home button, the service is still running, and also when I click the back button. But when I remove my application from the recent list of applications (pressing the "long house" button), the service stops. This is my call service code:
var SECONDS = 6; // every 10 minutes var intent = Titanium.Android.createServiceIntent({ url : 'myservice.js' }); intent.putExtra('interval', SECONDS * 1000); intent.putExtra('message_to_echo', num); //in millimeter var service = Titanium.Android.createService(intent); service.addEventListener('resume', function(e) { // num++; // alert(num); }); service.start();
And this is the file service code:
var service = Titanium.Android.currentService; var intent = service.intent; var message = intent.getStringExtra("message_to_echo"); var intent = Ti.Android.createIntent({ flags : Ti.Android.FLAG_ACTIVITY_CLEAR_TOP | Ti.Android.FLAG_ACTIVITY_SINGLE_TOP,
How can I start the service all the time, for example, that the application or something like that? Please help me, this is very important. Thanks in advance.
Hel00 source share