CloudPlugs REST Library  1.0.0
for Android
RestService Class Reference

An Android service for reliable sending of HTTP requests. This class is for internal usage. Do not create nor destroy this service directly, it is automatically managed by RestClient.

You need to declare this exact service in your AndroidManifest.xml to have it works, so add the following line inside the <application> tag: More...

Inheritance diagram for RestService:

Public Member Functions

void onCreate ()
 
void onDestroy ()
 
int startService (Intent intent, int startId)
 
- Public Member Functions inherited from BaseService
final int onStartCommand (Intent intent, int flags, int id)
 
abstract int startService (Intent intent, int startId)
 
IBinder onBind (Intent i)
 

Static Public Member Functions

static boolean isRunning ()
 
static boolean isStarting ()
 
static boolean isStopping ()
 
static boolean isConnected ()
 
static boolean shouldStart ()
 
static boolean shouldStop ()
 
static void start (Context ctx)
 
static void start (Context ctx, Integer wakeLockId)
 
static void stop (Context ctx)
 
static boolean hasListener (Listener l)
 
static void addListener (Listener l)
 
static void removeListener (Listener l)
 
static void removeAllListeners ()
 
- Static Public Member Functions inherited from BaseService
static synchronized int getNumOfHeldWakeLocks ()
 

Static Public Attributes

static final String EVT_CONN = "connState"
 
- Static Public Attributes inherited from BaseService
static final String EXT_WAKE_ID = NAME + ".wakeLockId"
 
static final int ID_NULL = 0
 
static final int WAKE_LOCK_TIMEOUT = 60*1000
 

Additional Inherited Members

- Static Protected Member Functions inherited from BaseService
static void addWakeLockId (Context ctx, Intent intent, Integer wakeLockId, boolean createIfNotExists)
 
static void addWakeLock (Context ctx, Intent i)
 
static Integer registerWakeLock (WakeLock wakeLock)
 
static WakeLock acquireWakeLock (Context ctx, String tag, long timeout)
 

Detailed Description

An Android service for reliable sending of HTTP requests. This class is for internal usage. Do not create nor destroy this service directly, it is automatically managed by RestClient.

You need to declare this exact service in your AndroidManifest.xml to have it works, so add the following line inside the <application> tag:

<service android:name="com.cloudplugs.rest.android.RestService" />

Later on you need to declare also the following permissions in your AndroidManifest.xml:

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />

Member Function Documentation

◆ addListener()

static void addListener ( Listener  l)
static

◆ hasListener()

static boolean hasListener ( Listener  l)
static

◆ isConnected()

static boolean isConnected ( )
static

◆ isRunning()

static boolean isRunning ( )
static

◆ isStarting()

static boolean isStarting ( )
static

◆ isStopping()

static boolean isStopping ( )
static

◆ onCreate()

void onCreate ( )

◆ onDestroy()

void onDestroy ( )

◆ removeAllListeners()

static void removeAllListeners ( )
static

◆ removeListener()

static void removeListener ( Listener  l)
static

◆ shouldStart()

static boolean shouldStart ( )
static

◆ shouldStop()

static boolean shouldStop ( )
static

◆ start() [1/2]

static void start ( Context  ctx)
static

◆ start() [2/2]

static void start ( Context  ctx,
Integer  wakeLockId 
)
static

◆ startService()

int startService ( Intent  intent,
int  startId 
)

◆ stop()

static void stop ( Context  ctx)
static

Member Data Documentation

◆ EVT_CONN

final String EVT_CONN = "connState"
static