Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development

Application Development Dev Lounge for the Coder Folks



Reply
 
LinkBack Thread Tools
Old March 2nd, 2010, 12:07 PM   #1 (permalink)
Junior Member
 
Join Date: Feb 2010
Location: Dublin
Posts: 16
 
Device(s):
Thanks: 2
Thanked 0 Times in 0 Posts
Default What class to use to run endless task on Android device

I am working on some Android project.
Apart from main Activity (user interface) I have a requirement to endlessly run an important TASK (in background) that every 30 seconds calls REST service to check for new data.
In case there are any new data the TASK has to notify about this fact the Activity.
This TASK needs to run even when the Activity was for instance moved to background and finished as a result of lack of device’s resources.
Initially I chose the TASK to be a class extending Service (as this is a class recommended for background work), but is there anything better (more reliable) for my requirements?
People generally don’t recommend Service for long-running tasks/services.


Thanks in advance!

horatio is offline  
Reply With Quote
Sponsors
Old March 2nd, 2010, 06:16 PM   #2 (permalink)
Over Macho Grande?
 
alostpacket's Avatar
 
Join Date: Nov 2009
Location: NY
Posts: 7,090
 
Device(s): GalaxyNexus(LTE), NexusOne, OG Droid, GalaxyTab 10.1(LTE), Eris, Logitech Revue (fishtank)
Thanks: 4,164
Thanked 3,126 Times in 1,292 Posts
Default

Quote:
Originally Posted by horatio View Post
People generally don’t recommend Service for long-running tasks/services.

Where do you read that? I thought it was the recommended way.
alostpacket is offline  
Reply With Quote
Old March 3rd, 2010, 07:38 AM   #3 (permalink)
Junior Member
 
Join Date: Feb 2010
Location: North Dallas (Plano)
Posts: 18
 
Device(s): T-Mobile My Touch 3G
Thanks: 0
Thanked 0 Times in 0 Posts
Smile

From what I have read you are supposed to use a service.

Rick
Baylro1970 is offline  
Reply With Quote
Reply

Bookmarks


Go Back   Android Forums > Android Development > Application Development User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Endless com.android.phone crash renders G1 useless fohlin G1 - Support 16 November 9th, 2011 03:36 AM
I have a 16GB Class 2 Micro SD. Upgrade to 32GB Micro SD Class 4 or wait for 32 GB Micro SD Class 6? DarkKirby The Lounge 8 December 21st, 2010 10:53 PM
Manfacturer selling computer device with Android device with free android apps? edamam Android Lounge 2 July 13th, 2010 07:58 AM
Astrid Task/Todo List: the de-facto task/todo manager for Android dultimaterunner Application Reviews 0 June 9th, 2010 01:25 AM
Another Task Killer/Task Manager for Android dcadar Application Announcements 3 May 27th, 2010 06:19 AM



All times are GMT -5. The time now is 12:17 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo