title: Write test case in Android application using Android Studio
body: <p>I am working in Android app that is already developed and I need to write test case for this app in Android Studio. I want to know how to write test case in Android Studio ?</p>
  
  <p>I also want to know what is main propose of writing test case? How to test app that we are writing write test cases?</p>
  
  <p>I have made test folder</p>
  
  <pre><code>public class LoginActivityTest extends ActivityInstrumentationTestCase2&lt;LoginActivity&gt; {
  
  private static final String LOGIN_DIALOG_FRAGMENT_TAG = NestAlertDialog.class.getSimpleName();
  
  private LoginActivity mActivity;
  private MainActivity mMainActivity;
  
  
  public LoginActivityTest() {
      super(LoginActivity.class);
  }
  </code></pre>