Skip to content

CentralHub

Ahmed Khalil edited this page Dec 8, 2017 · 4 revisions

CentralHub is the app's MainActivity. When an SMS or Slack message is received by the SMSComIN or SlackService classes, they are sent to the NLP for decoding. The Natural Language Processor (NLP) then files back the response, which is reported to CentralHub that then allocates the appropriate activity or service that must be started while passing the necessary parameters as an intent. Moreover, the user can manually enter their command on this activity's main screen rather than messaging it. Once the user hits the SEND button, the command is sent to the NLP. This can also be repeated through speech.

This class is written entirely in Kotlin.

class CentralHub : AppCompatActivity()

onCreate()

This method sets up the app's layout view. Furthermore, within it, the RobotController activity intent is declared. This method also checks for the presence of all the necessary permissions for the app to function without fail. To listen for any broadcasts from the NLP, the receiver is set up here.

fun mockSend(view: View){

This function sends the typed or spoken command to the NLP.

private val NLPReceiver = object : BroadcastReceiver()

// TODO

private fun startRobotController(action: String, actionParameter: String,platform: String)

// TODO

companion object

This is merely an object of the activity's TAG name for debugging purposes.

Clone this wiki locally