Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to save form data in database when submit button is clicked?
    primarykey
    data
    text
    <p>I am creating one android application in which I am using one form for enquiry.</p> <p>when the Enquiry button is clicked then application have to show one form . After completing the form entry user when user presses the Submit button then the data should save in database and form details have to be be send to the admin account via mail.</p> <p>I am searching in google but I am not getting exact what I want.</p> <p>Here is my code</p> <p>Order.java</p> <pre class="lang-java prettyprint-override"><code>package com.example.shaktitool; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; public class Order extends Activity{ private SQLiteAdapterOrder mySQLiteAdapter; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.order); mySQLiteAdapter = new SQLiteAdapterOrder(this); mySQLiteAdapter.openToWrite(); mySQLiteAdapter.deleteAll(); final MY_TABLE tb = new MY_TABLE(this); final EditText name = (EditText)findViewById(R.id.username); final EditText mail = (EditText)findViewById(R.id.email); final EditText phone = (EditText)findViewById(R.id.phone); final EditText product = (EditText)findViewById(R.id.product); final String _name = name.getText().toString(); final String _mail = mail.getText().toString(); final String _phone = phone.getText().toString(); final String _product = product.getText().toString(); System.out.println(_name); System.out.println(_mail); System.out.println(_phone); System.out.println(_product); Button email = (Button) findViewById(R.id.Button01); email.setOnClickListener(new View.OnClickListener(){ public void onClick(View v) { // TODO Auto-generated method stub tb.open(); final String _name = name.getText().toString(); final String _mail = mail.getText().toString(); final String _phone = phone.getText().toString(); final String _product = product.getText().toString(); System.out.println(name); Toast.makeText(getBaseContext(), "Record Saved",Toast.LENGTH_LONG).show(); System.out.println(mail); System.out.println(phone); System.out.println(product); tb.createorders(name, mail, phone, product); tb.delete("12"); tb.close(); } }); } } </code></pre> <p>can any one help me...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload