package com.javacodegeeks.android.androidtimerexample;

import android.app.Service;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.IBinder;
import android.widget.Toast;

//http://www.tutorialspoint.com/android/android_services.htm
//http://androidtrainningcenter.blogspot.fr/2012/04/simple-example-of-service-in-android.html
//http://stackoverflow.com/questions/4459058/alarm-manager-example
//https://coderwall.com/p/qfoxfg/schedule-a-service-using-alarmmanager
//https://dhimitraq.wordpress.com/2012/11/27/using-intentservice-with-alarmmanager-to-schedule-alarms/
//http://www.sanfoundry.com/java-android-program-start-service-every-hour/
//http://android-er.blogspot.fr/2011/04/start-service-to-send-notification.html

//http://stackoverflow.com/questions/25471337/using-alarmmanager-to-run-a-service-when-app-is-not-running
//https://androidcookbook.com/Recipe.seam?recipeId=844
//http://www.coderzheaven.com/2012/07/14/http-call-repeatedly-service-android/
//http://sampleprogramz.com/android/tasks.php

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;

//http://romain.raveaux.free.fr/document/Android/TD/TutorielAndroidBroadCastReceiver.pdf

//http://www.appsrox.com/android/tutorials/remindme/

public class Service01 extends Activity 
{

	@Override
	protected void onCreate(Bundle savedInstanceState) 
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.service01);
	}

	// Start the service
	public void startService(View view) 
	{
		startService(new Intent(this, Class_service01.class));
	}

	// Stop the service
	public void stopService(View view)
	{
		stopService(new Intent(this, Class_service01.class));
	}

}

/*public class Service01 extends Service 
{
	MediaPlayer myPlayer;
	
	@Override
	public IBinder onBind(Intent intent) 
	{
		return null;
	}
 
	@Override
	public void onCreate() 
	{
		Toast.makeText(this, "Service Created", Toast.LENGTH_LONG).show();
		myPlayer = MediaPlayer.create(this, R.raw.sun);
		myPlayer.setLooping(false); // Set looping
	}
 
	@Override
	public void onStart(Intent intent, int startid) 
	{
		Toast.makeText(this, "Service Started", Toast.LENGTH_LONG).show();
		myPlayer.start();
	}
 
	@Override
	public void onDestroy()
	{
		Toast.makeText(this, "Service Stopped", Toast.LENGTH_LONG).show();
		myPlayer.stop();
	}
}*/