title: How to get data from My_SQL database to android
body: <p>In my application, i want to display data that is saved in MY_SQL on android application TextViews. How can i do it</p>
  
  <p>my android application layout is:    </p>
  
  <pre><code>     &lt;LinearLayout 
           android:orientation="vertical"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:gravity="center"&gt;
  
  
      &lt;TextView
          android:id="@+id/textView2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/cus_name"
          android:gravity="center"
          android:clickable="true"
          android:focusable="true"
          android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
      &lt;TextView
          android:id="@+id/cus_name_txta"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:gravity="center"
          android:textAppearance="?android:attr/textAppearanceLarge"/&gt;
  
      &lt;/LinearLayout&gt;
  
     &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical"
          android:gravity="center"&gt;
  
      &lt;TextView
          android:id="@+id/textView3"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:gravity="center"
          android:text="@string/contact_no"
          android:clickable="true"
          android:focusable="true"
          android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
      &lt;TextView 
          android:id="@+id/contact_no_txta"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:gravity="center" /&gt;
  
     &lt;/LinearLayout&gt;
  
      &lt;LinearLayout 
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:orientation="vertical"
         android:gravity="center"&gt;
  
      &lt;TextView
               android:id="@+id/textView4"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:text="@string/ticket_no"
               android:clickable="true"
               android:focusable="true"
               android:gravity="center"
               android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
      &lt;TextView 
          android:id="@+id/ticket_no_txta"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:gravity="center"
          android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
     &lt;requestFocus /&gt;
  
      &lt;/LinearLayout&gt;
  
     &lt;LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:gravity="center"&gt;
  
      &lt;TextView
          android:id="@+id/textView5"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:clickable="true"
          android:focusable="true"
          android:gravity="center"
          android:text="@string/task_detail"
          android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
  
           &lt;TextView
               android:id="@+id/task_detail_txt"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:gravity="center"/&gt;
  
      &lt;/LinearLayout&gt;
  
  
  
       &lt;LinearLayout
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:gravity="center"
           android:orientation="vertical" &gt;
  
           &lt;TextView
               android:id="@+id/textView6"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:gravity="center"
               android:text="@string/attend_by"
               android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
              &lt;TextView 
          android:id="@+id/attend_by_txta"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:gravity="center"
          android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  </code></pre>
  
  <p></p>
  
  <p></p>
  
  <p>My java code is:</p>
  
  <pre><code>public static String attend_by_txt;
  
  TextView cus_name_txt, contact_no_txt, ticket_no_txt;
  TextView task_detail_txt;
   EditText attend_by_txtbx;
  
  
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.my_task);
  
  
      this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
  
  
      cus_name_txt = (TextView)findViewById(R.id.cus_name_txta);
  
             contact_no_txt = (TextView)findViewById(R.id.contact_no_txta);
  
      task_detail_txt = (TextView)findViewById(R.id.task_detail_txt);
  </code></pre>
  
  <p>I want that when i click on customer_name, Contact_No, ticket_No, Task_detail. it display data that is saved in MY_SQL. Please guide me how can i retrieve data from database and display it in android. I'll be very thankful to you.</p>