MCLExp9
MCLExp9
EXPERIMENT NO. 9
AIM: Implement an application that creates an alert upon receiving a message.
Procedure:
Creating a new project:
1. Open Android Studio and then click on File -> New -> New project.
2. Then type the Application name as “ex.no.9″ and click Next.
3. Then select the Minimum SDK and click Next.
4. Then select the Empty Activity and click Next.
5. Finally click Finish.
It will take some time to build and load the project.
Designing layout for the Android Application:
1. Click on app -> res -> layout -> activity_main.xml.
2. Now click on Text.
3. Then delete the code which is there and type the code as given below.
<TextView android:layout_margin="30dp"
android:layout_width="wrap_conten android:layout_gravity="center"
t" android:text="Notify"
android:textSize="30sp"/>
android:layout_height="wrap_conten
t" </LinearLayout>
android:text="Message"
android:textSize="30sp" />
<EditText
android:id="@+id/editText"
android:layout_width="match_paren
t
Vidyavardhini’s College of Engineering & Technology
Department of Computer Engineering
Academic Year: 2023-24
public class
MainActivity extends
AppCompatActivity
{
Button notify;
EditText e;
@Override
protected void
onCreate(Bundle
savedInstanceState)
{
Vidyavardhini’s College of Engineering & Technology
Department of Computer Engineering
Academic Year: 2023-24
OUTPUT:
CONCLUSION: Thus, Android Application that creates an alert upon receiving a message is
developed and executed successfully.
Vidyavardhini’s College of Engineering & Technology
Department of Computer Engineering
Academic Year: 2023-24