Background Services in Mono for Android: Listing 1

The MusicService class.

[Service]
	public class MusicService : Service
	{
	    public const string PlayCommand = "Play";
	    public const string StopCommand = "Stop";
	    public const string CommandExtraName = "Command";
	    private const int MusicPlayingNotification = 1;

	    private MediaPlayer _player;

	    public override IBinder OnBind(Intent intent)
	    {
	        return null;
	    }
	}

About the Author

Greg Shackles, Microsoft MVP, Xamarin MVP, is a Principal Engineer at Olo. He hosts the Gone Mobile podcast, organizes the NYC Mobile .NET Developers Group, and wrote Mobile Development with C# (O'Reilly). Greg is obsessed with heavy metal, baseball, and craft beer (he’s an aspiring home brewer). Contact him at Twitter @gshackles.

comments powered by Disqus

Featured

Subscribe on YouTube