Professional Documents
Culture Documents
Android Ass 2
Android Ass 2
Android Ass 2
Header-------------------------
NAME :AARTI SHARMA
CLASS :T.Y. BSC.CS
DIV :A
PC_NO :SRKI_60
ENROLLMENT ID :E19110192000310103
//---------------------------------------------------------------------------------
-------
<TextView
android:id="@+id/lbl_feedback"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Feedback form"
android:textAlignment="center"
android:textSize="30sp" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:paddingTop="30dp">
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="30dp">
<TextView
android:id="@+id/lbl_en_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Enrollment id" />
<EditText
android:id="@+id/txt_en_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="textPersonName" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/lbl_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Full Name" />
<EditText
android:id="@+id/txt_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="textPersonName" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/lbl_sem"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="semester" />
<Spinner
android:id="@+id/drop_down_sem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:spinnerMode="dropdown" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/lbl_select"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Please select " />
<RadioGroup
android:id="@+id/rg_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1">
<RadioButton
android:id="@+id/rdb_helpful"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Helpful " />
<RadioButton
android:id="@+id/rdb_not"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Not helpful" />
</RadioGroup>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/lbl_remark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Remark" />
<EditText
android:id="@+id/txt_remark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="textPersonName" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/lbl_tech"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="On which technology do you wish seminars in
future?" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<CheckBox
android:id="@+id/chx_cyber"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Cyber Security" />
<CheckBox
android:id="@+id/chx_datascience"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Data science" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent"
android:onClick="show_info">
<Button
android:id="@+id/btn_submit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:paddingLeft="20dp"
android:text="SUBMIT"
android:onClick="show_info"/>
</TableRow>
</TableLayout>
</LinearLayout>
package com.example.feedback_application;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.content.Intent;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btn_sub=findViewById(R.id.btn_submit);
txt_enroll=findViewById(R.id.txt_en_id);
txt_name=findViewById(R.id.txt_name);
txt_remark=findViewById(R.id.txt_remark);
rg_select=findViewById(R.id.rg_1);
c1=findViewById(R.id.chx_cyber);
c2=findViewById(R.id.chx_datascience);
drop_sem=findViewById(R.id.drop_down_sem);
ArrayAdapter<Integer> adp = new
ArrayAdapter<Integer>(getApplicationContext(),
android.R.layout.simple_spinner_dropdown_item,sem);
drop_sem.setAdapter(adp);
drop_sem.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener()
{
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int
i, long l) {
selected_sem=drop_sem.getSelectedItem().toString();
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
//----------------------------second activity-----------------------------
//try_activity.java
package com.example.feedback_application;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.Toast;