I am creating one android application in which I am using one form for enquiry.
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.
I am searching in google but I am not getting exact what I want.
Here is my code
Order.java
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();
}
});
}
}
can any one help me…
On submit insert values into the database as like this..
and in your datahelper class