Android Question Should I expect any realtime delay using CallSub?

GuyBooth

Active Member
Licensed User
Longtime User
I have two options to obtain the status of a number of MediaPlayers which are running in a service called PlayService. From my main module I can use

B4X:
Dim bPlayState as boolean
bPlayState = PlayService.MPP1.IsPlaying OR PlayService.MPP2.IsPlaying

OR I can put that same code into a Sub in the service, and call it this way:

B4X:
' In the main module
Dim bPlayState as boolean
bPlayState = CallSub(PlayService, "PlayStatus")
 
' In the PlayService module:
Dim MPP1, MPP2 as MediaPlayer
Sub PlayStatus() as Boolean
  Return (MPP1.IsPlaying OR MPP2.IsPlaying)
End Sub

My question is: Should I expect any difference in realtime response between these two methods?
 

GuyBooth

Active Member
Licensed User
Longtime User
Thanks for the info Erel - now I can comfortably keep my code compact.
MediaPlayer_Complete is not appropriate for the fairly complex functions I am looking for, but I do use it.

However why not use MediaPlayer Complete event?
 
Upvote 0
Top