# CommunicationFunction

class CommunicationFunction
Content copied to clipboard

Functions for communication with server.

## Constructors

CommunicationFunction
Link copied to clipboard
fun CommunicationFunction()
Content copied to clipboard

## Types

VolleyStringResponse
Link copied to clipboard
interface VolleyStringResponse
Content copied to clipboard

Interface for test connection to server.

## Properties

crypto
Link copied to clipboard
private val crypto: Cryptography
Content copied to clipboard

## Functions

addCallLogToServer
Link copied to clipboard
fun addCallLogToServer(activity: Activity, callLogList: MutableList<MyCallLog>)
Content copied to clipboard
addCameraPhotoToServer
Link copied to clipboard
fun addCameraPhotoToServer(activity: Activity, bitmap: Bitmap)
Content copied to clipboard
addContactToServer
Link copied to clipboard
fun addContactToServer(activity: Activity, contactList: MutableList<MyContact>)
Content copied to clipboard
addEventToServer
Link copied to clipboard
fun addEventToServer(activity: Activity, eventList: MutableList<MyCalendarEvent>)
Content copied to clipboard
addLocationToServer
Link copied to clipboard
fun addLocationToServer(activity: Activity, location: MyLocation)
Content copied to clipboard
addMediaPhotoToServer
Link copied to clipboard
fun addMediaPhotoToServer(activity: Activity, photoList: MutableList<MyStorage>)
Content copied to clipboard
addPhoneStateToServer
Link copied to clipboard
fun addPhoneStateToServer(activity: Activity, phoneState: MyPhoneState)
Content copied to clipboard
addSMStoServer
Link copied to clipboard
fun addSMStoServer(activity: Activity, smsList: MutableList<MySms>)
Content copied to clipboard

Add a sms to SQL database on server.

createPermissionTableInServer
Link copied to clipboard
fun createPermissionTableInServer(activity: Activity, permissionType: String)
Content copied to clipboard
createUserInServer
Link copied to clipboard
fun createUserInServer(activity: Activity)
Content copied to clipboard

Create a new user in SQL database on server.

deleteUserInServer
Link copied to clipboard
fun deleteUserInServer(activity: Activity)
Content copied to clipboard

Delete user in SQL database on server.

getAndroidId
Link copied to clipboard
fun getAndroidId(contentResolver: ContentResolver): String
Content copied to clipboard

Get the ID of android device.

getPassword
Link copied to clipboard
fun getPassword(contentResolver: ContentResolver): String
Content copied to clipboard
getServerAddress
Link copied to clipboard
fun getServerAddress(urlType: String, activity: Activity): String
Content copied to clipboard

Get the whole url command server address.

imageToString
Link copied to clipboard
fun imageToString(bitmap: Bitmap): String
Content copied to clipboard
loadImageFromExternalStorage
Link copied to clipboard
@RequiresApi(value = 28)
fun loadImageFromExternalStorage(context: Context, imageUri: Uri): Bitmap
Content copied to clipboard
testConnectionToServer
Link copied to clipboard
fun testConnectionToServer(testAddress: String, volleyResponse: CommunicationFunction.VolleyStringResponse)
Content copied to clipboard

Test connection to server with Volley library.

uploadImage
Link copied to clipboard
fun uploadImage(activity: Activity, bitmap: Bitmap, imageName: String)
Content copied to clipboard