package com.example.db01;


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;

import android.app.ActionBar;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.os.Environment;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.FilterQueryProvider;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;

import java.nio.channels.*;
import java.util.ArrayList;
import java.io.FileWriter;

public class MainActivity extends Activity
{

		private DbAdapter dbHelper;
		private SimpleCursorAdapter dataAdapter;

		@Override
		public void onCreate(Bundle savedInstanceState)
		{
			 	super.onCreate(savedInstanceState);
			 	setContentView(R.layout.activity_main);
			 	
				
			 	dbHelper = new DbAdapter(this);
			 	dbHelper.open();
		
			 	displayListView();
			 	
			 	Toast.makeText(getApplicationContext(), "Validation", Toast.LENGTH_LONG).show();
			 	
/*			 	
			 	Alarm id_alarm = new Alarm();
			 	id_alarm.setName("nom");
			 	id_alarm.setFromDate("un");
			 	id_alarm.setToDate("deux");
			 	id_alarm.setRule("trois");
			 	id_alarm.setInterval("quatre");
			 	id_alarm.setSound(false);
			 	dbHelper.addAlarm(id_alarm);
*/			
		}

		private void displayListView()
	 	{	

	 	}
		
		
		public void onClick(View v) 
		{
			switch (v.getId())
			{
				case R.id.imageButton1:
					//startActivity(new Intent(this, SettingsActivity.class));
					break;		
				case R.id.imageButton2:
					startActivity(new Intent(this, AddAlarm.class));
					break;
				case R.id.imageButton3:
					//move(-1);
					//rangeText.setText(getRangeStr());
					//((SimpleCursorAdapter)getListAdapter()).changeCursor(createCursor());
					break;
				case R.id.imageButton4:
					//move(+1);
					//rangeText.setText(getRangeStr());
					//((SimpleCursorAdapter)getListAdapter()).changeCursor(createCursor());
					break;			
			}
		}
		
		
}