com.todoroo.astrid.sync
Class SyncBackgroundService

java.lang.Object
  extended by android.content.Context
      extended by android.content.ContextWrapper
          extended by android.app.Service
              extended by com.todoroo.astrid.sync.SyncBackgroundService
All Implemented Interfaces:
android.content.ComponentCallbacks

public abstract class SyncBackgroundService
extends android.app.Service

Performs synchronization service logic in background service to avoid ANR (application not responding) messages.

Starting this service schedules a repeating alarm which handles synchronization with your serv

Author:
Tim Su

Field Summary
 
Fields inherited from class android.content.Context
ACCESSIBILITY_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, AUDIO_SERVICE, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, INPUT_METHOD_SERVICE, KEYGUARD_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MODE_APPEND, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NOTIFICATION_SERVICE, POWER_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, TELEPHONY_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
 
Constructor Summary
SyncBackgroundService()
           
 
Method Summary
 android.os.IBinder onBind(android.content.Intent intent)
           
 void onStart(android.content.Intent intent, int startId)
          Receive the alarm - start the synchronize service!
 void scheduleService()
          Schedules repeating alarm for auto-synchronization
 void stop()
           
 
Methods inherited from class android.app.Service
getApplication, onConfigurationChanged, onCreate, onDestroy, onLowMemory, onRebind, onUnbind, setForeground, stopSelf, stopSelf, stopSelfResult
 
Methods inherited from class android.content.ContextWrapper
bindService, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkUriPermission, checkUriPermission, clearWallpaper, createPackageContext, databaseList, deleteDatabase, deleteFile, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getBaseContext, getCacheDir, getClassLoader, getContentResolver, getDatabasePath, getDir, getFilesDir, getFileStreamPath, getMainLooper, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getSystemService, getTheme, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isRestricted, openFileInput, openFileOutput, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, removeStickyBroadcast, revokeUriPermission, sendBroadcast, sendBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendStickyBroadcast, setTheme, setWallpaper, setWallpaper, startActivity, startInstrumentation, startService, stopService, unbindService, unregisterReceiver
 
Methods inherited from class android.content.Context
getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SyncBackgroundService

public SyncBackgroundService()
Method Detail

onStart

public void onStart(android.content.Intent intent,
                    int startId)
Receive the alarm - start the synchronize service!

Overrides:
onStart in class android.app.Service

onBind

public android.os.IBinder onBind(android.content.Intent intent)
Specified by:
onBind in class android.app.Service

stop

public void stop()

scheduleService

public void scheduleService()
Schedules repeating alarm for auto-synchronization