You are on page 1of 5

Exit App

import kotlin.system.exitProcess

eapp.setOnClicklistner

Util.stopRugbeeService(requireContext())

RugbeeManager.getInstance().disconnectAll(prefs.lastConnectedDevice)

updateConnectionStatus()

exitProcess(0)

Disconnect

Click on disconnect button

 Util.stopRugbeeService(requireContext())

RugbeeManager.getInstance().disconnectAll(prefs.lastConnectedDevice)

fdfv.text =""

updateConnectionStatus()

Then call service status broadcast receiver

Button Tured Off

When we turn off the button of rugbee device


RugbeeManager.getInstance().disconnectAll(prefs.lastConnectedDevice)

updateConnectionStatus()

Button Turned on

prefs.lastConnectedDevice.isEmpty()

Util.startRugbeeService(context!!)

 if(RugbeeSessionService.serviceState != ServiceState.CONNECTED) {

 dialogBuilder.setMessage("Please wait..")

 TTSManager.playNow("Please wait!Now Rugbee is ready for gesture ")


Exit App

Imported the library from kotlin to exit the process

eapp is the id for exit button


and when we click on exit button

Is used to stop rugbee services

Then it call the rugbeemanager from


rugbee manager we call disconnect function to disconnect
the last connected device

It updates the connection status on UI


Toast message rugbee is offline
And plays sound rugbee is ofline

Exits from all the processes i.e. exit from application

Disconnect

Starts the disconnect activity

Is used to stop rugbee services

Then it call the rugbeemanager from


rugbee manager we call disconnect function to disconnect
the last connected device
Shows the last connected device

It updates the connection status on UI


Toast message rugbee is offline
And plays sound rugbee is ofline

In which we update the status of device

tton Tured Off


Then it call the rugbeemanager from
rugbee manager we call disconnect function to disconnect
the last connected device

It updates the connection status on UI


Toast message rugbee is offline
And plays sound rugbee is ofline

tton Turned on

Check the last connected device(Which was locked) is empty


or not If empty then show no device in snack bar

If not empty means the last connected device is available then

It starts the rugbee services

Then switch ragbee to the connected state and connect the last
connected device

You might also like