com.beem.project.beem
Class BeemService

Package class diagram package BeemService
java.lang.Object
  extended by android.content.Context
      extended by android.content.ContextWrapper
          extended by android.app.Service
              extended by com.beem.project.beem.BeemService
All Implemented Interfaces:
ComponentCallbacks

public class BeemService
extends Service

This class is for the Beem service. It must contains every global informations needed to maintain the background service. The connection to the xmpp server will be made asynchronously when the service will start.


Field Summary
static int NOTIFICATION_STATUS_ID
          The id to use for status notification.
 
Fields inherited from class android.app.Service
START_CONTINUATION_MASK, START_FLAG_REDELIVERY, START_FLAG_RETRY, START_NOT_STICKY, START_REDELIVER_INTENT, START_STICKY, START_STICKY_COMPATIBILITY
 
Fields inherited from class android.content.Context
ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, AUDIO_SERVICE, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_NOT_FOREGROUND, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, DEVICE_POLICY_SERVICE, DROPBOX_SERVICE, 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, UI_MODE_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
 
Constructor Summary
BeemService()
          Constructor.
 
Method Summary
 XmppConnectionAdapter createConnection()
          Create the XmppConnectionAdapter.
 void deleteNotification(int id)
          Delete a notification.
 IXmppFacade getBind()
          Return a bind to an XmppFacade instance.
 NotificationManager getNotificationManager()
          Get the notification manager system service.
 SharedPreferences getServicePreference()
          Get the preference of the service.
 void initJingle(XMPPConnection adaptee)
          Initialize Jingle from an XmppConnectionAdapter.
 IBinder onBind(Intent intent)
          
 void onCreate()
          
 void onDestroy()
          
 void onStart(Intent intent, int startId)
          
 boolean onUnbind(Intent intent)
           
 void resetStatus()
          Reset the status to online after a disconnect.
 void sendNotification(int id, Notification notif)
          Show a notification using the preference of the user.
 
Methods inherited from class android.app.Service
dump, finalize, getApplication, onConfigurationChanged, onLowMemory, onRebind, onStartCommand, setForeground, startForeground, stopForeground, stopSelf, stopSelf, stopSelfResult
 
Methods inherited from class android.content.ContextWrapper
attachBaseContext, 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, getExternalCacheDir, getExternalFilesDir, 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, sendStickyOrderedBroadcast, setTheme, setWallpaper, setWallpaper, startActivity, startInstrumentation, startIntentSender, 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
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOTIFICATION_STATUS_ID

public static final int NOTIFICATION_STATUS_ID
The id to use for status notification.

See Also:
Constant Field Values
Constructor Detail

BeemService

public BeemService()
Constructor.

Method Detail

onBind

public IBinder onBind(Intent intent)

Specified by:
onBind in class Service

onUnbind

public boolean onUnbind(Intent intent)
Overrides:
onUnbind in class Service

onCreate

public void onCreate()

Overrides:
onCreate in class Service

onDestroy

public void onDestroy()

Overrides:
onDestroy in class Service

onStart

public void onStart(Intent intent,
                    int startId)

Overrides:
onStart in class Service

createConnection

public XmppConnectionAdapter createConnection()
Create the XmppConnectionAdapter. This method makes a network request so it must not be called on the main thread.

Returns:
the connection

sendNotification

public void sendNotification(int id,
                             Notification notif)
Show a notification using the preference of the user.

Parameters:
id - the id of the notification.
notif - the notification to show

deleteNotification

public void deleteNotification(int id)
Delete a notification.

Parameters:
id - the id of the notification

resetStatus

public void resetStatus()
Reset the status to online after a disconnect.


initJingle

public void initJingle(XMPPConnection adaptee)
Initialize Jingle from an XmppConnectionAdapter.

Parameters:
adaptee - XmppConnection used for jingle.

getBind

public IXmppFacade getBind()
Return a bind to an XmppFacade instance.

Returns:
IXmppFacade a bind to an XmppFacade instance

getServicePreference

public SharedPreferences getServicePreference()
Get the preference of the service.

Returns:
the preference

getNotificationManager

public NotificationManager getNotificationManager()
Get the notification manager system service.

Returns:
the notification manager service.


Copyright © 2009 Beem-project.com. All Rights Reserved.