public AudioPlayerImplementation() { applicationContext = Application.Context; mediaPlayerServiceIntent = new Intent(applicationContext, typeof(MediaPlayerService)); mediaPlayerServiceConnection = new MediaPlayerServiceConnection(this); applicationContext.BindService(mediaPlayerServiceIntent, mediaPlayerServiceConnection, Bind.AutoCreate); }
/// <summary> /// The connect. /// </summary> /// <param name="context"> /// The context. /// </param> public void Connect(Context context) { var bindIntent = new Intent(context, this.serviceTypeType); bindIntent.PutExtra(ClientMessageParameters.Messenger, this.messenger); bool bound = context.BindService(bindIntent, this.serviceConnection, Bind.DebugUnbind); if (!bound) { Debug.WriteLine("LVLDL Service Unbound"); } }