Name of the Experiment- Receive data from the user by Edit Text and pass the data to another
activity using intent.
Coding Phase: Pseudo code/ Flow Chart / Algorithm
Intent: It is devided in to 2 types i.e Implicit intent and another is Explicit intent.
[Link] Intent:-
Testing Phase: Compilation of Code(error detection)
Implementation Phase : Final Output (no error)
Activity_main.xml file-
<?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">
<ImageView
android:id="@+id/imageView"
android:layout_width="403dp"
android:layout_height="724dp"
app:srcCompat="@drawable/img"
tools:layout_editor_absoluteX="2dp"
tools:layout_editor_absoluteY="-2dp"
tools:ignore="MissingConstraints" />
<Button
android:id="@+id/button"
android:layout_width="193dp"
android:layout_height="76dp"
android:layout_centerHorizontal="true"
android:onClick="clk"
android:text="CLICK"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.865"
tools:ignore="MissingConstraints" />
</[Link]>
[Link]-
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
}
public void clk(View v) {
Intent intent = new Intent(Intent.ACTION_VIEW, [Link]("[Link]
startActivity(intent);
}
}
[Link] intent:-
Coding Phase: Pseudo code/ Flow Chart / Algorithm
Implementation Phase : Final Output (no error)
Activity_main.xml file-1
<?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">
<ImageView
android:id="@+id/imageView"
android:layout_width="434dp"
android:layout_height="740dp"
app:srcCompat="@drawable/img"
tools:layout_editor_absoluteX="-13dp"
tools:layout_editor_absoluteY="-5dp" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Whatever happened was good.
What’s happening is going well.
Whatever will happen will also be good.
Do not worry about the future.
Live in the present.
Jay Shree Krishna"
android:textColor="@color/white"
android:textSize="40sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
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.484" />
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:linksClickable="false"
android:text="Click"
android:textColorLink="#FFFFFF"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.497"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView"
app:layout_constraintVertical_bias="0.974" />
</[Link]>
Activity_main.xml file-2
<?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=".Second">
<ImageView
android:id="@+id/imageView2"
android:layout_width="612dp"
android:layout_height="860dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.361"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
app:srcCompat="@drawable/img_1" />
<TextView
android:id="@+id/textView2"
android:layout_width="313dp"
android:layout_height="73dp"
android:text="Thanku Krishna"
android:textColor="#F4F4F4"
android:textColorLink="#FFFFFF"
android:textSize="40sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.591"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.957" />
</[Link]>
[Link]-1
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class MainActivity<find> extends AppCompatActivity {
private Button button;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
onClickButtonListener();
}
public void onClickButtonListener()
{
button=(Button)findViewById([Link]);
[Link](new [Link]() {
@Override
public void onClick(View view) {
Intent intent=new Intent([Link],[Link]);
startActivity(intent);}
});
}
}
[Link]-2
package [Link];
import [Link];
import [Link];
public class MainActivity2 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main2);
}
}
Output
CONCLIUSION:-
successfully completed the Receive data from the user by Edit Text and pass the data to another activity
using intent.
ASSESSMENT
Rubrics Full Mark Marks Obtained Remarks
Concepts 10
Planning and Execution/ 10
Practical Simulation/Programming
Result and Interpretation 10
Record of Applied and Action Learning 10
Viva 10
Total 50
Signature of the Student:
Signature of Faculty Name:
Regn. No. :
Page No…..