title: Creating a stopwatch timer in Android
body: <p>I have created the layout and here is its code but I don't know how should I change the mainactivity.java and also what are the things which I should add to string.xml file:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical" &gt;
  
        &lt;TextView
          android:id="@+id/androidtimer"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:gravity="center"
          android:text="Android Timer"
          android:textSize="40sp"
          android:textStyle="bold"
          android:textColor="#FF0000"/&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
       android:layout_height="match_parent"
       android:orientation="horizontal"
       android:gravity="bottom|center" &gt;
      &lt;Button
          android:id="@+id/start"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:background="#FF0000"
          android:text=" start "
          android:textSize="35sp"
          android:textColor="#FFFFFF"
          android:onClick="startTimer"
  /&gt;
      &lt;View
          android:layout_width="20dp"
          android:layout_height="1dp"/&gt;
         &lt;Button
          android:id="@+id/stop"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:background="#FF0000"
          android:text=" stop "
          android:textSize="35sp"
          android:textColor="#FFFFFF"
          android:onClick="stopTimer"
  
      /&gt;
             &lt;/LinearLayout&gt;
      &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>It'll be great if you can give me some pointers for continuing. I am new to Android mobile development and couldn't find a step by step tutorial for a stopwatch timer.</p>