private void addSapaListeners() { if (mSapaAppService != null) { mSapaAppService.addAppStateListener(this); mSapaAppService.addConnectionListener(this); } }
private void connectConnectionBridge() { Log.d(TAG, "Connect using bridge"); mSapaAppService = new SapaAppService(this); //MainService starts listening for establishment of connection. //MainService needs to implement AudioServiceConnectListener to be able to listen for this event. //When event occurs onServiceConnected() method is called. mSapaAppService.addConnectionListener(this); //MainService declares that it defines actions for this application. //MainService needs to implement AudioActionDefinerInterface. mSapaAppService.ActionDefiner = this; mSapaAppService.addAppStateListener(mSapaAppStateListener); //Connection to AudioConnectionService starts being created. mSapaAppService.connect(); }