public abstract class Module extends MenuActivity
Modifier and Type | Field and Description |
---|---|
protected static boolean |
isConnected
Connection available flag
|
protected Object |
result
Webservice result.
|
dbHelper, isDebuggable
Constructor and Description |
---|
Module() |
Modifier and Type | Method and Description |
---|---|
protected void |
addParam(String param,
Object value)
Adds a parameter to webservice request.
|
protected abstract void |
connect()
Launches action in a separate thread while shows a progress dialog in UI
thread.
|
protected void |
createRequest(String clientType)
Creates webservice request.
|
void |
onActivityResult(int requestCode,
int resultCode,
Intent data) |
protected void |
onCreate(Bundle savedInstanceState) |
protected abstract void |
onError()
Error handler
|
protected void |
onPause() |
protected void |
onResume() |
protected void |
onStart() |
protected abstract void |
postConnect()
Launches action after executing connect() method
|
protected abstract void |
requestService()
Connects to SWAD and gets user data.
|
protected void |
runConnection()
Run connection.
|
protected void |
sendRequest(Class<?> cl,
boolean simple)
Sends a SOAP request to the specified webservice in METHOD_NAME class
constant of the webservice client.
|
protected void |
sendRequest(Class<?> cl,
boolean simple,
RESTClient.REQUEST_TYPE type,
JSONObject json)
Sends a REST request to the specified webservice in METHOD_NAME class
constant of the webservice client.
|
protected void |
setMETHOD_NAME(String METHOD_NAME)
Sets METHOD_NAME parameter.
|
protected void |
startConnection(boolean showDialog,
String progressDescription,
int progressTitle) |
error, onCreateOptionsMenu, onOptionsItemSelected, showDialog
protected Object result
protected static boolean isConnected
protected abstract void requestService() throws Exception
protected abstract void connect()
protected abstract void postConnect()
protected abstract void onError()
protected void runConnection()
protected void onCreate(Bundle savedInstanceState)
onCreate
in class MenuActivity
protected void onPause()
onPause
in class MenuActivity
protected void onResume()
onResume
in class MenuActivity
protected void onStart()
public void onActivityResult(int requestCode, int resultCode, Intent data)
protected void setMETHOD_NAME(String METHOD_NAME)
METHOD_NAME
- METHOD_NAME parameter.protected void createRequest(String clientType)
protected void addParam(String param, Object value)
param
- Parameter name.value
- Parameter value.protected void sendRequest(Class<?> cl, boolean simple) throws Exception
cl
- Class to be mappedsimple
- Flag for select simple or complex responseException
protected void sendRequest(Class<?> cl, boolean simple, RESTClient.REQUEST_TYPE type, JSONObject json) throws ClientProtocolException, CertificateException, IOException, JSONException
cl
- Class to be mappedsimple
- Flag for select simple or complex responsetype
- Request typejson
- JSON object to be sendedClientProtocolException
IOException
JSONException
CertificateException
protected void startConnection(boolean showDialog, String progressDescription, int progressTitle)