0% found this document useful (0 votes)
6 views6 pages

Simple Form Design

simple form design in android studio

Uploaded by

Divya Raj
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views6 pages

Simple Form Design

simple form design in android studio

Uploaded by

Divya Raj
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Simple Form Design – Android Application

XML CODE

<?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">

<ScrollView
android:layout_width="370dp"
android:layout_height="429dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.121">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Personal Information"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.06" />

<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:text="Full Name"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.026"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.052" />

<EditText
android:id="@+id/editname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:ems="10"
android:inputType="textPersonName"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.094"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.052" />

<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="E-Mail"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.046"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.052" />

<EditText
android:id="@+id/editmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:ems="10"
android:inputType="textPersonName"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.094"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.052" />

<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="Blood Group"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.052"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.052" />

<EditText
android:id="@+id/editblood"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:ems="10"
android:inputType="textPersonName"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.094"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.052" />

<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="100dp"
android:text="Educational Information"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.052" />

<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="260dp"
android:text="SSLC Percentage"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.094"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.052" />

<EditText
android:id="@+id/editsslc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="152dp"
android:ems="10"
android:inputType="textPersonName"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.217" />

<TextView
android:id="@+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="264dp"
android:text="HSC Percentage"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.341" />

<EditText
android:id="@+id/edithsc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="148dp"
android:ems="10"
android:inputType="textPersonName"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.443" />

<TextView
android:id="@+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="304dp"
android:text="UG CGPA"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.548" />

<EditText
android:id="@+id/editug"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="148dp"
android:ems="10"
android:inputType="textPersonName"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.655" />

<TextView
android:id="@+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="304dp"
android:text="Skills"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.548" />

<EditText
android:id="@+id/editskill"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="148dp"
android:ems="10"
android:inputType="textPersonName"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.655" />
</LinearLayout>
</ScrollView>

<Button
android:id="@+id/personalsubmit"
android:layout_width="233dp"
android:layout_height="46dp"
android:layout_marginEnd="84dp"
android:text="Submit"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.989" />

</[Link]>

JAVA CODE

package [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 Activity {

EditText ename,econtact,eblood,esslc,ehsc,eug,eskill;
Button personalsubmit;

@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);

ename=findViewById([Link]);
econtact=findViewById([Link]);
eblood=findViewById([Link]);
esslc=findViewById([Link]);
ehsc=findViewById([Link]);
eug=findViewById([Link]);
eskill=findViewById([Link]);

personalsubmit=findViewById([Link]);

[Link](new [Link]() {
@Override
public void onClick(View v) {

try {

String seperator=" ";


String newline="\n";
FileOutputStream data=openFileOutput("mydata",MODE_PRIVATE);
[Link]([Link]().toString().getBytes());
[Link]([Link]().getBytes());
[Link]([Link]().toString().getBytes());
[Link]([Link]().getBytes());
[Link]([Link]().toString().getBytes());
[Link]([Link]().getBytes());
[Link]([Link]().toString().getBytes());
[Link]([Link]().getBytes());
[Link]([Link]().toString().getBytes());
[Link]([Link]().getBytes());
[Link]([Link]().toString().getBytes());
[Link]([Link]().getBytes());
[Link]([Link]().toString().getBytes());
[Link]([Link]().getBytes());

[Link]();
[Link](getApplicationContext(), "Personal Information\n Name -
"+[Link]().toString()+
"\nE Mail - "+[Link]().toString()+
"\nBlood Group - "+[Link]().toString()+
"\nSSLC Percentage - "+[Link]().toString()+
"\nHSC Percentage - "+[Link]().toString()+
"\nUG CGPA - "+[Link]().toString()+
"\nSkills - "+[Link]().toString()

, Toast.LENGTH_LONG).show();

} catch (FileNotFoundException e) {
[Link]();
} catch (IOException e) {
[Link]();
}
}

});

}
}
OUTPUT

You might also like