Skip to content

Using Android Intents

  • TMM supports several Android intents you can use to configure and control the program.
  • An intent may trigger TMM to show user interface, or it may do a configuration action in the background.
  • An intent may return information to the calling program, or it may simply perform the requested action without any return.

On Android, TMM uses the REGISTER Intent mechanism to register client applications.

intent.putExtra("applicationID", applicationID)
startActivityForResult(intent, registerRequestCode)
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == registerRequestCode) {
if (resultCode == RESULT_OK) {
// registrationResult:
// OK: Your app is registered
// Unauthorized: TMM was not able to verify the Application ID
// NoNetwork: There is not internet connection
val registrationResult = data?.getStringExtra("registrationResult")
val locationPort = data?.getIntExtra("locationPort", -1)
val locationV2Port = data?.getIntExtra("locationV2Port", -1)
val apiPort = data?.getIntExtra("apiPort", -1)
}
}
}