Mad Lab Procedures To Write
Mad Lab Procedures To Write
KEYBAORD
DATE:
AIM: Develop an android application to display the internal keyboard in the emulator
PROCEDURE:
1. Open android Studio
2. From File Menu, Choose New-> Android Application Project
3. Give the project name (Example: keyboard)
4. Click Next and Choose the Blank Activity and Click Finish
5. In the explorer window choose the res folder and choose layout
6. Double click Layout and open the activity_main.xml file by double clicking the file
7. From the bottom Tab, Choose Graphical Layout.
8. From the pallete in the left side of the graphical window drag a Large Text view
controland place it in the activity window
9. Similarly, drag a button control from the pallete and place it in the activity window.
10. Right Click on the button and choose Edit Text and click New String.
11. Right Click on the src folder in the explorer window and choose the
MainActivity.javafile.
12. Double Click the MainActivity.java file and write the following in the file in the
publicclass MainActivity area.
Example:
Name: MIE
Subject: mobile application development
Message: Android studio
TASK-3
TOAST
DATE:
PROCEDURE:
1. Open android Studio
2. From File Menu, Choose New-> Android Application Project
3. Give the project name (Example: Toast)
4. Click Next and Choose the Blank Activity and Click Finish
5. In the explorer window choose the res folder and choose layout
6. Double click Layout and open the activity_main.xml file by double clicking the file
fromthe bottom Tab, Choose Graphical Layout.
7. From the pallete in the left side of the graphical window drag a Large Text view
controland place it in the activity window
8. Similarly, drag a button control from the pallete and place it in the activity window.
9. Right Click on the button and choose Edit Text and click New String.
10. Right Click on the src folder in the explorer window and choose the
MainActivity.javafile.
11. Double Click the MainActivity.java file and write the following in the file in the
publicclass MainActivity area.
TASK-4
TEXT AND TOAST
DATE:
AIM: Write an android program to input a text through a text and the same must be displayed
inthe toast when a button is clicked on the screen
PROCEDURE:
1. Open android Studio
2. From File Menu, Choose New-> Android Application Project
3. Give the project name (Example: TextandToast)
4. Click Next and Choose the Empty Activity and Click Finish
5. In the explorer window choose the res folder and choose layout
6. Double click Layout and open the activity_main.xml file by double clicking the file
fromthe bottom Tab, Choose Graphical Layout.
7. From the pallete in the left side of the graphical window drag a Large Text view
controland place it in the activity window
8. Similarly, drag a button control from the pallete and place it in the activity window.
9. Right Click on the button and choose Edit Text and click New String.
10. Right Click on the src folder in the explorer window and choose the
MainActivity.javafile.
11. Double Click the MainActivity.java file and write the following in the file in the
publicclass MainActivity area.
12. Now, run the application. We can see the text bar and Display text button, In that text
barwe can write any message (example: MOBILE APPLICATION DEVELOPMENT).
13. Click on display text button, it will display on the bottom on the mobile screen.
Example:
Enter your Name Here: Android Studio
Click on Display text button.
TASK-5
ARITHMETIC OPERTIONS
DATE:
PROCEDURE:
1. Open android Studio
2. From File Menu, Choose New-> Android Application Project
3. Give the project name (Example: Arithmetic operations)
4. Click Next and Choose the Empty Activity and Click Finish
5. In the explorer window choose the res folder and choose layout
6. Double click Layout and open the Activity_main.xml file by double clicking the
fileFrom the bottom Tab, Choose Graphical Layout.
7. From the pallete in the left side of the graphical window drag a Large TextView
controland place it in the activity window.
8. Similarly, drag a button control from the pallete and place it in the activity window.
9. Right Click on the button and choose Edit Text and click New String
10. Right Click on the src folder in the explorer window and choose the
MainActivity.javafile.
11. Double click the MainActivity.java file and write the following in the file in the
publicclass MainActivity area.
12. Now run the application to perform arithmetic operations in the mobile application
APIstudio.
13. Given a sample input to perform any operation like addition, subtraction etc.
14. In the case of division operator we can write the code that float type, then only we can
getthe exact answer for division operator in decimal point.
Example:
5
10
Click on Addition/Add.
TASK-6
STUDENT MARK LIST
DATE:
AIM: Develop an android application to process a student mark list by creating proper UI
usingthe necessary controls.
PREOCEDURE:
1. Open android Studio
2. From File Menu, Choose New-> Android Application Project
3. Give the project name (Example: keyboard)
4. Click Next and Choose the Blank Activity and Click Finish
5. In the explorer window choose the res folder and choose layout
6. Double click Layout and open the activity_main.xml file by double clicking the file
fromthe bottom Tab, Choose Graphical Layout.
7. From the pallete in the left side of the graphical window drag a Large Text view
controland place it in the activity window
8. Similarly, drag a button control from the pallete and place it in the activity window.
9. Right Click on the button and choose Edit Text and click New String.
10. Right Click on the src folder in the explorer window and choose the
MainActivity.javafile.
11. Double Click the MainActivity.java file and write the following in the file in the
publicclass MainActivity area.
12. We can run the application and once’s check grade files and run. We type message
and click on add mark then only the student details are stored in the application, and
we cansee the message of student mark list details when click on the add mark.
Example:
Enter student name:
Ragit
haEnter Subject: MIE
Enter Marks: 100
Enter Subject: STM
Enter Marks: 80
Enter Subject: CNS
Enter Marks: 90
Click on AddMark
TASK-7
FRAGMENT EXAMPLE
DATE:
PROCEDURE:
1. Open android Studio
2. From File Menu, Choose New-> Android Application Project
3. Give the project name (Example: keyboard)
4. Click Next and Choose the Blank Activity and Click Finish
5. In the explorer window choose the res folder and choose layout.
6. Double click Layout and open the MainActivity.java file and write the following in
thefile in the public class MainActivity area.
7. Double click the activity_main.xml file and write the fragment1.java and
fragment2.javain that activity_main.xml to display the output.
8. Create a fragment_fragment1.xml and fragment_fragment2.xml by clicking to the
createnew file in your project.
9. After that create java class files fragment1.java and fragment2.java. write a code and
saveit.
10. After completed the code writing we can run the grade files to see the errors and after
thatwe can run the application.
TASK-8
CALCULATOR
PROCEDURE:
TASK-9
DEPARTMENTS DATE:
PROCEDURE:
1. Open Android Studio and then click on File-> New -> New Project.
2. Then type the Application name as “departments”.
3. Then select the Empty Activity and click Next.
4. Finally click Finish.
5. Click on app-> res-> layout->Activity_main.xml.
6. Now click on Text show below.
7. Then delete the code which is there and type the code as given below.
8. Click on app-> res-> layout->com.example.departments -> Main Activity.
9. Then delete the code which is there and type the code as given below.
10. Click on create new java and xml files in project that name as listitemactivity1.
Javaand listitemactivity2.java and also create same as like xml.
11. Create on string.xml file. Run the application before that we can run the grade file
andthe execution of that application.
TASK-10
LIST ITEM DIALOGUE BOX DATE:
AIM: Design an android application to display a list of items on the android screen. If the
users clicks any one of the list items a dialogue box should show that user has clicked that
particular item.
PROCEDURE:
1. Open Android Studio and then click on File-> New -> New Project.
2. Then type the Application name as “listitemdialogue”.
3. Then select the Empty Activity and click Next.
4. Finally click Finish.
5. Click on app-> res-> layout->Activity_main.xml.
6. Now click on Text show below.
7. Then delete the code which is there and type the code as given below.
8. Click on app-> res-> layout->com.example.listitemdialogue -> Main Activity.
9. Then delete the code which is there and type the code as given below.
10. Run the application before that we can run the grade file and the execution of
thatapplication.
TASK-11
SERVICE TOAST DATE:
AIM: Design an android application to create a service that shows the service is running in the
background in the form of a toast.
PROCEDURE:
1. Open Android Studio and then click on File-> New -> New Project.
2. Then type the Application name as “servicetoast”.
3. Then select the Empty Activity and click Next.
4. Finally click Finish.
5. Click on app-> res-> layout->Activity_main.xml.
6. Now click on Text show below.
7. Then delete the code which is there and type the code as given below.
8. Click on app-> res-> layout->com.example.servicetoast -> Main Activity.
9. Then delete the code which is there and type the code as given below.
10. Run the application before that we can run the grade file and the execution of
thatapplication.
TASK-12
INTENT DATE:
AIM: Develop an android application if the user clicks the button its navigates to the
nextactivity(Using intents).
PROCEDURE:
1. Open Android Studio and then click on File-> New -> New Project.
2. Then type the Application name as “intent”.
3. Then select the Empty Activity and click Next.
4. Finally click Finish.
5. Click on app-> res-> layout->Activity_main.xml.
6. Now click on Text show below.
7. Then delete the code which is there and type the code as given below.
8. Click on app-> res-> layout->com.example.intent -> Main Activity.
9. Then delete the code which is there and type the code as given below.
10. Run the application before that we can run the grade file and the execution of
thatapplication.