package [Link].
sq;
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class MainActivity extends AppCompatActivity {
Button b1,b2,b3;
TextView t;
SQLiteDatabase db;
String d1,d2,d3,d4,d5;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
b1=findViewById([Link].b1);
b2=findViewById([Link].b2);
b3=findViewById([Link].b3);
t=findViewById([Link].t);
db=openOrCreateDatabase("student", Context.MODE_PRIVATE, null);
[Link]("CREATE TABLE IF NOT EXISTS stud1(name VARCHAR(20),rollno NUMBER,marks
NUMBER,branch VARCHAR(20),per NUMBER);");
public void insert(View v){
[Link]("INSERT INTO stud1 VALUES('ajinkya',10,890,'CM',90);");
[Link]("INSERT INTO stud1 VALUES('abc',11,800,'CM',91);");
[Link]("INSERT INTO stud1 VALUES('pqr',10,870,'CM',78);");
[Link]("INSERT INTO stud1 VALUES('ijk',10,890,'CM',80);");
[Link]("INSERT INTO stud1 VALUES('lmn',10,690,'CM',67);");
[Link](this,"record inserted", Toast.LENGTH_LONG).show();
public void view(View v){
String s6;
int total = 0, n;
Cursor C3=[Link]("select * from stud1;",null);
[Link]();
if(![Link]())
do{
s6 = [Link](0)+[Link](1)+[Link](2)+[Link](3)+[Link](4);
[Link]("\n" + s6);
}while([Link]());
public void delete(View v){
[Link]("DELETE FROM stud1 where name="+"'ajinkya';");
[Link](this,"record deleted", Toast.LENGTH_LONG).show();
}
<?xml version="1.0" encoding="utf-8"?>
<[Link]
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="insert"
android:onClick="insert"
android:id="@+id/b1"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="view"
android:onClick="view"
android:id="@+id/b2"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="delete"
android:onClick="delete"
android:id="@+id/b3"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/t"/>
</LinearLayout>
</[Link]>