0% found this document useful (0 votes)
251 views51 pages

Mobile Application Laboratory Manual (Vtu)

1. This document provides guidelines for evaluating students in the Mobile Application Development laboratory course at RNS Institute of Technology. 2. Students will be evaluated based on their performance in regular lab evaluations, a mini project, maintaining records, and overall participation. The evaluations assess students' understanding, programming ability, documentation skills, and more. 3. Detailed rubrics are provided to guide the evaluation of students' work in the laboratory sessions and mini project on parameters such as problem comprehension, program design and testing, documentation, and conceptual knowledge.

Uploaded by

Vibgfjjb
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)
251 views51 pages

Mobile Application Laboratory Manual (Vtu)

1. This document provides guidelines for evaluating students in the Mobile Application Development laboratory course at RNS Institute of Technology. 2. Students will be evaluated based on their performance in regular lab evaluations, a mini project, maintaining records, and overall participation. The evaluations assess students' understanding, programming ability, documentation skills, and more. 3. Detailed rubrics are provided to guide the evaluation of students' work in the laboratory sessions and mini project on parameters such as problem comprehension, program design and testing, documentation, and conceptual knowledge.

Uploaded by

Vibgfjjb
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
You are on page 1/ 51

RNS INSTITUTE OF TECHNOLOGY

(AICTE Approved, VTU Affiliated and NAAC 'A' Accredited)


UG Programs - CSE, ECE, ISE, EIE and EEE have been Accredited by NBA for three Academic years
DR. VISHNUVARDHAN ROAD, CHANNASANDRA, RR NAGAR POST, BENGALURU – 560 098

Department of Computer Science and Engineering

MOBILE APPLICATION DEVELOPMENT


LABORATORY
MANUAL

For Sixth Semester B.E-2018 Batch


[VTU/CBCS, 2018-19 syllabus]
Subject Code – 18CSMP68

NAME :
............................................................................................................................. ................................................................................................................................................................................................................................................................ ..........................................

USN: ............................................................................................................................. ............................................................................................................................. ................................................................................................................................... ........................................

SECTION : ...........................................................................................................................................................................................

VISION
USN :
AND MISSION OF INSTITUTION
VISION AND MISSION OF INSTITUTION
Vision
Building RNSIT into a World Class Institution

Mission
To impart high quality education in Engineering, Technology and Management with a
Difference, Enabling Students to Excel in their Career by
1. Attracting quality Students and preparing them with a strong foundation in fundamentals so as to
achieve distinctions in various walks of life leading to outstanding contributions
2. Imparting value based, need based, choice based and skill based professional education to the
aspiring youth and carving them into disciplined, World class Professionals with social
responsibility
3. Promoting excellence in Teaching, Research and Consultancy that galvanizes academic
consciousness among Faculty and Students
4. Exposing Students to emerging frontiers of knowledge in various domains and make them
suitable for Industry, Entrepreneurship, Higher studies, and Research & Development
5. Providing freedom of action and choice for all the Stake holders with better visibility

VISION AND MISSION OF CSE DEPARTMENT

Vision
Preparing better computer professionals for a real world
Mission
The Department of Computer Science and Engineering will make every effort to promote an
intellectual and an ethical environment in which the strengths and skills of Computer
Professionals will flourish by
1. Imparting Solid foundations and Applied aspects in both Computer Science Theory and
Programming practices
2. Providing Training and encouraging R&D and Consultancy Services in frontier areas of
Computer Science with a Global outlook
3. Fostering the highest ideals of Ethics, Values and creating Awareness on the role of Computing
in Global Environment
4. Educating and preparing the graduates, highly Sought-after, Productive, and Well-respected for
their work culture
5. Supporting and inducing Lifelong Learning practice
[DOCUMENT TITLE]
Mobile Application Development Laboratory- 18CSMP68
INTERNAL EVALUATION SHEET

EVALUATION (MAX MARKS 40)


TEST REGULAR EVALUATION MINI PROJECT RECORD TOTAL MARKS
A B C D A+B+C+D

10 10 10 10 40

R1: REGULAR LAB EVALUATION WRITE UP RUBRIC (MAX MARKS 10)


Sl. Needs
Parameters Good Average
No. improvement
a. Understanding of Clear understanding of problem Problem statement is understood Problem statement is not
problem statement while designing and clearly but few mistakes while clearly understood while
(3 marks) implementing the program (3) designing and implementing designing the program
program (2) (1)
b. Writing program Program handles all possible Average condition is defined and Program does not handle
(4 marks) conditions (4) verified. (3) possible conditions (1)

c. Result and Meticulousdocumentation and Acceptable documentation shown Documentation does not
documentation all conditions are taken care (3) (2) take care all conditions
(3 marks) (1)

R2: REGULAR LAB EVALUATION VIVA RUBRIC (MAX MARKS 10)


Sl. Needs
Parameter Excellent Good Average
No. Improvement
a. Conceptual Answers 80% of the Answers 60% of the viva Answers 30% of the Unable to relate the
understanding viva questions asked questions asked (7) viva questions asked concepts (1)
(10 marks) (10) (4)

R3: REGULAR LAB PROGRAM EXECUTION RUBRIC (MAX MARKS 10)

Sl.
Parameters Excellent Good Needs Improvement
No.
a. Design, implementation Program follows syntax and Program has few logical Syntax and semantics
and demonstration semantics of the programming errors, moderately of programming is not
(5 marks) language. Demonstrates the demonstrates all possible clear (1)
complete knowledge of the concepts implemented in
program written (5) programs (3)
b. Result and All test cases are successful, all Moderately debugs the Test cases are not taken
documentation errors are debugged with own programs , few test case are care , unable to debug
(5 marks) practical knowledge and clear unsuccessful and Partial the errors and no proper
documentation according to the documentation documentation (1)
guidelines (5) (3)

R4: RECORD EVALUATION RUBRIC (MAX MARKS 10)


Sl. Needs
Parameter Excellent Good Average
No. Improvement
a. Documentation Meticulous record writing Write up contains Write up contains Program written
(10 marks) including program, comments program and test only program (5) with few
and test cases as per the cases, but comments mistakes (3)
guidelines mentioned (10) are not included (8)

Department of CSE , RNSIT


[DOCUMENT TITLE]

R5: MINI PROJECT EVALUATION RUBRIC (MAX MARKS 10)


Needs
Sl. No Parameters Good Average
improvement
1 Understanding Clear understanding of Moderate understanding of Less than 30% of the
theProblem problem statement and 50% problem statement and 30% project work is
statement, Design implementationof the implementation of the project(3) completed with minimal
project(4) understanding of the
and
problem statement(2)
Implementation(4
marks)
2 Demonstration of Complete knowledge about Moderate knowledge about all Minimal knowledge of
Legitimate Results all possible concepts possible concepts implemented concepts implemented in
and documentation implemented in project and in project along with the project and poor
(6 marks) clear documentation documentation according to the documentation (2)
according to the guidelines guidelines (5)
(6)

A. TEST /LAB INTERNALS MARKS (MAX MARKS 10)

Write up Execution Viva Sign Total Avg. Final


TEST # 6 28 6 40 40 10

TEST-1
TEST-2 𝟒𝟎 𝟏𝟎

B. REGULAR LAB EVALUATION (MAX MARKS 10)

Write
Date of Exen. Viva Total Teacher
Week # Additional programs up
Execution (10) (10) 30 Signature
(10)

Total
Marks 𝟐𝟒𝟎 𝟑𝟎 𝟏𝟎

Department of CSE , RNSIT


[DOCUMENT TITLE]
C. MINI PROJECT EVALUATION (MAX MARKS 10)

TITLE OF THE
PROJECT

TEAM MEMBERS

Date of Design Demonstration Viva Total Avg. Final


REVIEW
Conduction (7) (26) (7) (40) 40 10

1
2 𝟒𝟎 𝟏𝟎

REMARKS

FINAL MARKS OBTAINED


Lab in charge
A : TEST (10)
signature with date:
B : REGULAR EVALUATION (10) TOTAL
(A+B+C+D)
C: MINI PROJECT(10)

D: RECORD (10) 𝟒𝟎

Department of CSE , RNSIT


PREFACE

We have developed this comprehensive laboratory manual on Mobile Application Development with
two primary objectives: To make the students comfortable with basic layout design in application
development and to train them in evolving as an efficient Android Developer by strengthening their
programming abilities.

The manual comprises of procedure for configuration of Android Studio followed by programming
solutions with expected output layouts.

Our profound and sincere efforts will be fruitful only when students acquire the extensive knowledge
by reading this manual and apply the concepts learnt apart from the requirements specified in C
Programming Laboratory as prescribed by VTU, Belagavi.

Department of CSE
Mobile Application Development Laboratory( 18CSMP68)

[DOCUMENT TITLE]
SYLLABUS
MOBILE APPLICATION DEVELOPMENTLABORATORY
Subject Code: 18CSMP68 IA Marks: 40

No. of Practical Hrs. / Week: 0:0:2 Exam Marks: 60

Total No. of Practical Hrs: 3 Hours/Week Exam Hours: 03

Lab Experiments:
1. The installation procedure of the Android Studio/Java software must be demonstrated
and carried out in groups.
2. Students should use the latest version of Android Studio/Java/ Kotlin to execute these
programs. Diagrams given are for representational purposes only, students are
expected to improvise on them.
3. Part B programs should be developed as an application and are to be demonstrated as
a mini project in a group by adding extra features or the students can also develop
their application and demonstrate it as a mini-project. (Projects/programs are not
limited to the list given in Part B).
PART A
Program 1

Create an application to design a Visiting Card. The Visiting card should have a company logo
at the top right corner. The company name should be displayed in Capital letters, aligned to the
center. Information like the name of the employee, job title, phone number, address, email, fax
and the website address is to be displayed. Insert a horizontal line between the job title and the
phone number.

Department of CSE, RNSIT Page | 1


Mobile Application Development Laboratory( 18CSMP68)

[DOCUMENT TITLE]
Program 2

Develop an Android application using controls like Button, TextView, EditText for designing a
Calculator having basic functionality like Addition, Subtraction, Multiplication, and Division.

Program 3

Create a SIGN Up activity with Username and Password. Validation of password should
happen based on the following rules:
• Password should contain uppercase and lowercase letters.
• Password should contain letters and numbers.
• Password should contain special characters.
• Minimum length of the password (the default value is 8).

On successful SIGN UP proceed to the next Login activity. Here the user should SIGN IN
using the Username and Password created during signup activity. If the Username and
Password are matched then navigate to the next activity which displays a message saying
“Successful Login” or else display a toast message saying “Login Failed”. The user is given
only two attempts and after that display a toast message saying “Failed Login Attempts” and
disable the SIGN IN button. Use Bundle to transfer information from one activity to another

Department of CSE, RNSIT Page | 2


Mobile Application Development Laboratory( 18CSMP68)

[DOCUMENT TITLE]
Program 4

Develop an application to set an image as wallpaper. On click of a button, the wallpaper image
should start to change randomly every 30 seconds.

Program 5

Write a program to create an activity with two buttons START and STOP. On Pressing of the
START button, the activity must start the counter by displaying the numbers from One and the
counter must keep on counting until the STOP button is pressed. Display the counter value in a
TextView control.

Program 6

Create two files of XML and JSON type with values for City_Name, Latitude, Longitude,
Temperature, and Humidity. Develop an application to create an activity with two buttons to
parse the XML and JSON files which when clicked should display the data in their respective
layouts side by side.

Department of CSE, RNSIT Page | 3


Mobile Application Development Laboratory( 18CSMP68)

[DOCUMENT TITLE]

Program 7

Develop a simple application with one Edit Text so that the user can write some text in it.
Create a button called “Convert Text to Speech” that converts the user input text into voice.

Program 8

Create an activity like a phone dialer with CALL and SAVE buttons. On pressing the CALL
button, it must call the phone number and on pressing the SAVE button it must save the
number to the phone contacts

Department of CSE, RNSIT Page | 4


Mobile Application Development Laboratory( 18CSMP68)

[DOCUMENT TITLE]
PART B
Program 1

Write a program to enter Medicine Name, Date and Time of the Day as input from the user and
store it in the SQLite database. Input for Time of the Day should be either Morning or
Afternoon or Evening or Night. Trigger an alarm based on the Date and Time of the Day and
display the Medicine Name.

Program 2

Develop a content provider application with an activity called “Meeting Schedule” which takes
Date, Time and Meeting Agenda as input from the user and store this information into the
SQLite database. Create another application with an activity called “Meeting Info” having
DatePicker control, which on the selection of a date should display the Meeting Agenda
information for that particular date, else it should display a toast message saying “No Meeting
on this Date”.

Department of CSE, RNSIT Page | 5


Mobile Application Development Laboratory( 18CSMP68)

[DOCUMENT TITLE]
Program 3

Create an application to receive an incoming SMS which is notified to the user. On clicking
this
SMS notification, the message content and the number should be displayed on the screen. Use
appropriate emulator control to send the SMS message to your application

Program 4

Write a program to create an activity having a Text box, and also Save, Open and Create
buttons. The user has to write some text in the Text box. On pressing the Create button the text
should be saved as a text file in MkSDcard. On subsequent changes to the text, the Save button
should be pressed to store the latest content to the same file. On pressing the Open button, it
should display the contents from the previously stored files in the Text box. If the user tries to
save the contents in the Textbox to a file without creating it, then a toast message has to be
displayed saying “FirstCreate a File”.

Department of CSE, RNSIT Page | 6


Mobile Application Development Laboratory( 18CSMP68)

[DOCUMENT TITLE]
Program 5

Create an application to demonstrate a basic media player that allows the user to Forward,
Backward, Play and Pause an audio. Also, make use of the indicator in the seek bar to move the
audio forward or backward as required.

Program 6

Develop an application to demonstrate the use of Asynchronous tasks in android. The


asynchronous task should implement the functionality of a simple moving banner. On pressing
the Start Task button, the banner message should scroll from right to left. On pressing the Stop
Task button, the banner message should stop. Let the banner message be “Demonstration of
Asynchronous Task

Program 7

Develop an application that makes use of the clipboard framework for copying and pasting of
the text. The activity consists of two EditText controls and two Buttons to trigger the copy and
paste functionality.

Department of CSE, RNSIT Page | 7


Mobile Application Development Laboratory( 18CSMP68)

[DOCUMENT TITLE]

Program 8

Create an AIDL service that calculates Car Loan EMI. The formula to calculate EMI is
E = P * (r(1+r)n)/((1+r)n-1)
where
E = The EMI payable on the car loan amount
P = The Car loan Principal Amount
r = The interest rate value computed on a monthly basis
n = The loan tenure in the form of months

The down payment amount has to be deducted from the principal amount paid towards buying
the Car. Develop an application that makes use of this AIDL service to calculate the EMI. This
application should have four EditText to read the Principal Amount, Down Payment, Interest
Rate, Loan Term (in months) and a button named as “Calculate Monthly EMI”. On click of this
button, the result should be shown in a TextView. Also, calculate the EMI by varying the Loan
Term and Interest Rate values.

Department of CSE, RNSIT Page | 8


Mobile Application Development Lab (18CSMP68)

1) Create an application to design a visiting Card. The Visiting card should have a company logo at
the top right corner. The company name should be displayed in Capital letters, aligned to the
center. Information like the name of the employee, job title, phone number, address, email, fax
and the website address isto be displayed. Insert a horizontal line between the job title and the
phone number.

MainActivity.java

package com.example.visitingcard;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}

Activity_main.xml

<?xml version="1.0" encoding="utf-8"?>


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignWithParentIfMissing="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:animateLayoutChanges="false"
android:background="#F3F1ED"
android:divider="@android:drawable/bottom_bar"
android:orientation="vertical"
android:layout_marginTop="10dp"
android:paddingLeft="1dp"
android:paddingTop="1dp"
tools:context=".MainActivity">

Page 1
Mobile Application Development Lab (18CSMP68)

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="100dp">

<TextView
android:layout_width="390dp"
android:layout_height="89dp"
android:layout_marginLeft="20dp"
android:capitalize="sentences"
android:fontFamily="casual"
android:foregroundGravity="center"
android:paddingLeft="10dp"
android:paddingRight="20dp"
android:text="\nRNS INSTITUTE OF TECHNOLOGY\n"
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
android:textColor="#06114E"
android:textSize="20sp"
android:textStyle="bold|italic"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginLeft="350dp"
android:layout_marginTop="30dp"
android:layout_marginRight="20dp"
android:src="@drawable/icon3" />
</RelativeLayout>

<TableRow
android:id="@+id/hr"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#CE851414"
android:paddingTop="10dp"
android:paddingBottom="10dp"></TableRow>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"

Page 2
Mobile Application Development Lab (18CSMP68)

android:fontFamily="serif-monospace"
android:paddingLeft="20dp"
android:paddingTop="20dp"
android:text="Name : Vibha V\n\nJob Title : Student\nPhone Number : 9482263118\n"
android:textColor="#1E0202"
android:textSize="20dp" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:fontFamily="serif-monospace"
android:paddingLeft="20dp"
android:text="Address : #657, 22nd cross \n\t\t Kumaraswamy Layout ,\t Bengaluru\n"
android:textColor="#170101"
android:textSize="20dp" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:fontFamily="serif-monospace"
android:paddingLeft="20dp"
android:text="EMail : [email protected]\n Fax : 080 - 26663118\n\nWebsite :
www.github.com/vibha-v-657"
android:textColor="#220303"
android:textSize="20dp" /></LinearLayout>

Page 3
Mobile Application Development Lab (18CSMP68)

2) Develop an Android application using controls like Button, TextView, EditText for
designing a Calculator having basic functionality like Addition, Subtraction, Multiplication,
and Division.

activity_main.xml

<?xml version="1.0" encoding="utf-8"?>


<androidx.constraintlayout.widget.ConstraintLayoutxmlns:android="http://schemas.andr
oid.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="match_parent"
tools:context=".MainActivity">

<Button android:id="@+id/button_clear" android:layout_width="87dp" android:layout_height="53dp"


android:layout_marginTop="30dp" android:text="C"
app:layout_constraintStart_toStartOf="@+id/button_add"
app:layout_constraintTop_toBottomOf="@+id/button_add" />

<Button android:id="@+id/button_sub" android:layout_width="87dp" android:layout_height="53dp"


android:layout_marginStart="20dp" android:layout_marginTop="30dp" android:text="-"
app:layout_constraintStart_toEndOf="@+id/button_three"
app:layout_constraintTop_toBottomOf="@+id/button_mul" />

<Button android:id="@+id/button_add" android:layout_width="87dp" android:layout_height="53dp"


android:layout_marginStart="20dp" android:layout_marginTop="30dp" android:text="+"
app:layout_constraintStart_toEndOf="@+id/button_equal"
app:layout_constraintTop_toBottomOf="@+id/button_sub" />

<Button android:id="@+id/button_mul" android:layout_width="87dp" android:layout_height="53dp"


android:layout_marginStart="20dp" android:layout_marginTop="30dp" android:text="*"

Page 4
Mobile Application Development Lab (18CSMP68)

app:layout_constraintStart_toEndOf="@+id/button_six"
app:layout_constraintTop_toBottomOf="@+id/button_div" />

<Button android:id="@+id/button_equal" android:layout_width="62dp" android:layout_height="53dp"


android:layout_marginStart="20dp" android:layout_marginTop="30dp" android:text="="
app:layout_constraintStart_toEndOf="@+id/button_zero"
app:layout_constraintTop_toBottomOf="@+id/button_three" />

<Button android:id="@+id/button_zero" android:layout_width="62dp" android:layout_height="53dp"


android:layout_marginStart="20dp" android:layout_marginTop="30dp" android:text="0"
app:layout_constraintStart_toEndOf="@+id/button_dot"
app:layout_constraintTop_toBottomOf="@+id/button_two" />

<Button android:id="@+id/button_dot" android:layout_width="62dp" android:layout_height="53dp"


android:layout_marginStart="20dp" android:layout_marginTop="30dp" android:text="."
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/button_one" />

<Button android:id="@+id/button_three" android:layout_width="62dp" android:layout_height="53dp"


android:layout_marginStart="20dp" android:layout_marginTop="30dp" android:text="3"
app:layout_constraintStart_toEndOf="@+id/button_two"
app:layout_constraintTop_toBottomOf="@+id/button_six" />

<Button android:id="@+id/button_two" android:layout_width="62dp" android:layout_height="53dp"


android:layout_marginStart="20dp" android:layout_marginTop="30dp" android:text="2"
app:layout_constraintStart_toEndOf="@+id/button_one"
app:layout_constraintTop_toBottomOf="@+id/button_five" />

<Button android:id="@+id/button_one" android:layout_width="62dp" android:layout_height="53dp"


android:layout_marginStart="20dp" android:layout_marginTop="30dp" android:text="1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/button_four" />

<Button android:id="@+id/button_six" android:layout_width="62dp" android:layout_height="53dp"


android:layout_marginStart="20dp" android:layout_marginTop="30dp" android:text="6"
app:layout_constraintStart_toEndOf="@+id/button_five"
app:layout_constraintTop_toBottomOf="@+id/button_nine" />

<Button android:id="@+id/button_seven" android:layout_width="62dp" android:layout_height="53dp"


android:layout_marginStart="20dp" android:layout_marginTop="20dp" android:text="7"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/txt_result"
/>

<Button android:id="@+id/button_eight" android:layout_width="62dp" android:layout_height="53dp"


android:layout_marginStart="20dp" android:layout_marginTop="20dp" android:text="8"

Page 5
Mobile Application Development Lab (18CSMP68)

app:layout_constraintStart_toEndOf="@+id/button_seven"
app:layout_constraintTop_toBottomOf="@+id/txt_result" />

<Button android:id="@+id/button_nine" android:layout_width="62dp" android:layout_height="53dp"


android:layout_marginStart="20dp" android:layout_marginTop="20dp" android:text="9"
app:layout_constraintStart_toEndOf="@+id/button_eight"
app:layout_constraintTop_toBottomOf="@+id/txt_result" />

<Button android:id="@+id/button_four" android:layout_width="62dp" android:layout_height="53dp"


android:layout_marginStart="20dp" android:layout_marginTop="30dp" android:text="4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/button_seven" />

<TextView android:id="@+id/textView" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:layout_marginTop="30dp" android:text="SIMPLE
CALCULATOR" android:textSize="26dp" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" />

<TextView android:id="@+id/textView2" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:layout_marginStart="20dp"
android:layout_marginTop="20dp" android:text="Result" android:textSize="18dp"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@+id/textView" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView" />

<EditText android:id="@+id/txt_result" android:layout_width="310dp" android:layout_height="46dp"


android:layout_marginTop="20dp" android:ems="10" android:inputType="textPersonName"
app:layout_constraintStart_toStartOf="@+id/textView2"
app:layout_constraintTop_toBottomOf="@+id/textView2" />

<Button android:id="@+id/button_div" android:layout_width="87dp" android:layout_height="53dp"


android:layout_marginStart="20dp" android:layout_marginTop="20dp"
android:text="/" app:layout_constraintStart_toEndOf="@+id/button_nine"
app:layout_constraintTop_toBottomOf="@+id/txt_result" />

<Button android:id="@+id/button_five" android:layout_width="62dp" android:layout_height="53dp"


android:layout_marginStart="20dp" android:layout_marginTop="30dp" android:text="5"
app:layout_constraintStart_toEndOf="@+id/button_four"
app:layout_constraintTop_toBottomOf="@+id/button_eight" />
</androidx.constraintlayout.widget.ConstraintLayout>

MainActivity.java

package com.example.partaprogram2;

Page 6
Mobile Application Development Lab (18CSMP68)

import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle;


import android.view.View; import android.widget.Button; import android.widget.EditText; import
android.widget.Toast;

import java.util.regex.Pattern;

public class MainActivityextendsAppCompatActivityimplementsView.OnClickListener { Button btnOne,


btnTwo, btnThree, btnFour, btnFive, btnSix;
Button btnSeven, btnEight, btnNine, btnZero; Button btnAdd,btnSub,btnMul,btnDiv;
Button btnClear,btnEqual,btnDot; EditTexttxtResult;
@Override
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

btnOne=(Button)findViewById(R.id.button_one); btnOne.setOnClickListener(this);
btnTwo=(Button)findViewById(R.id.button_two); btnTwo.setOnClickListener(this);
btnThree=(Button)findViewById(R.id.button_three); btnThree.setOnClickListener(this);
btnFour=(Button)findViewById(R.id.button_four); btnFour.setOnClickListener(this);
btnFive=(Button)findViewById(R.id.button_five); btnFive.setOnClickListener(this);
btnSix=(Button)findViewById(R.id.button_six); btnSix.setOnClickListener(this);
btnSeven=(Button)findViewById(R.id.button_seven); btnSeven.setOnClickListener(this);
btnEight=(Button)findViewById(R.id.button_eight); btnEight.setOnClickListener(this);
btnNine=(Button)findViewById(R.id.button_nine); btnNine.setOnClickListener(this);
btnZero=(Button)findViewById(R.id.button_zero); btnZero.setOnClickListener(this);
btnAdd=(Button)findViewById(R.id.button_add); btnAdd.setOnClickListener(this);
btnSub=(Button)findViewById(R.id.button_sub); btnSub.setOnClickListener(this);
btnMul=(Button)findViewById(R.id.button_mul); btnMul.setOnClickListener(this);
btnDiv=(Button)findViewById(R.id.button_div); btnDiv.setOnClickListener(this);
btnClear=(Button)findViewById(R.id.button_clear); btnClear.setOnClickListener(this);
btnEqual=(Button)findViewById(R.id.button_equal); btnEqual.setOnClickListener(this);
btnDot=(Button)findViewById(R.id.button_dot); btnDot.setOnClickListener(this);

txtResult=(EditText)findViewById(R.id.txt_result); txtResult.setText("");
}

public void onClick(View v)


{
if(v.equals(btnOne)) txtResult.append("1"); if(v.equals(btnTwo)) txtResult.append("2");
if(v.equals(btnThree)) txtResult.append("3"); if(v.equals(btnFour)) txtResult.append("4");
if(v.equals(btnFive)) txtResult.append("5"); if(v.equals(btnSix)) txtResult.append("6");
if(v.equals(btnSeven)) txtResult.append("7"); if(v.equals(btnEight)) txtResult.append("8");
if(v.equals(btnNine)) txtResult.append("9"); if(v.equals(btnZero)) txtResult.append("0");
if(v.equals(btnDot)) txtResult.append("."); if(v.equals(btnClear)) txtResult.setText("");

if(v.equals(btnEqual))

Page 7
Mobile Application Development Lab (18CSMP68)

{
try {

String data = txtResult.getText().toString(); if (data.contains("/")) {


String[] operands = data.split("/"); if(operands.length==2) {
double operand1 = Double.parseDouble(operands[0]); double operand2 =
Double.parseDouble(operands[1]); double result = operand1 / operand2;
txtResult.setText(String.valueOf(result));
}
else
{
Toast.makeText(getBaseContext(),"Invalid Input", Toast.LENGTH_LONG).show();
}

}
else if (data.contains("*")) {
String[] operands = data.split(Pattern.quote("*")); if(operands.length==2) {
double operand1 = Double.parseDouble(operands[0]); double operand2 =
Double.parseDouble(operands[1]);
double result = operand1 * operand2; txtResult.setText(String.valueOf(result));
}
else
{
Toast.makeText(getBaseContext(),"Invalid Input", Toast.LENGTH_LONG).show();
}

}
else if (data.contains("+")) {
String[] operands = data.split(Pattern.quote("+")); if(operands.length==2) {
double operand1 = Double.parseDouble(operands[0]); double operand2 =
Double.parseDouble(operands[1]); double result = operand1 + operand2;
txtResult.setText(String.valueOf(result));
}
else
{
Toast.makeText(getBaseContext(),"Invalid Input", Toast.LENGTH_LONG).show();
}
}
else if (data.contains("-")) { String[] operands = data.split("-"); if(operands.length==2) {
double operand1 = Double.parseDouble(operands[0]); double operand2 =
Double.parseDouble(operands[1]); double result = operand1 - operand2;
txtResult.setText(String.valueOf(result));
}
else
{

Page 8
Mobile Application Development Lab (18CSMP68)

Toast.makeText(getBaseContext(),"Invalid Input", Toast.LENGTH_LONG).show();


}
}
}

catch(Exception e) { Toast.makeText(getBaseContext(),"Invalid Input", Toast.LENGTH_LONG).show();


}
}
if(v.equals(btnAdd)) txtResult.append("+"); if(v.equals(btnSub)) txtResult.append("-");
if(v.equals(btnMul)) txtResult.append("*"); if(v.equals(btnDiv)) txtResult.append("/");
}
}

Page 9
Mobile Application Development Lab (18CSMP68)

3) Create a SIGN Up activity with Username and Password. Validation of password should
happen based on the following rules:
Password should contain uppercase and lowercase letters.
Password should contain letters and numbers.
Password should contain special characters.
Minimum length of the password (the default value is 8).
On successful SIGN UP proceed to the next Login activity. Here the user should SIGN IN
using the Username and Password created during signup activity. If the Username and
Password are matched then navigate to the next activity which displays a message saying
“Successful Login” or else display a toast message saying “Login Failed”. The user is
given only two attempts and after that display a toast message saying “Failed Login
Attempts” and disable the SIGN IN button. Use Bundle to transfer information from one
activity to another.

Activity_main.xml

<?xml version="1.0" encoding="utf-8"?>


<androidx.constraintlayout.widget.ConstraintLayoutxmlns:android="http://schemas.andr
oid.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="match_parent"
tools:context=".MainActivity">

<TextView android:id="@+id/textView2" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:layout_marginTop="100dp" android:text="SIGN UP"
android:textColor="@android:color/background_dark" android:textSize="22dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView android:id="@+id/textView3" android:layout_width="wrap_content"


android:layout_height="wrap_content"

android:layout_marginStart="30dp" android:layout_marginTop="50dp" android:text="USERNAME"


app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView2" />

Page 10
Mobile Application Development Lab (18CSMP68)

<TextView android:id="@+id/textView4" android:layout_width="82dp" android:layout_height="34dp"


android:layout_marginTop="50dp" android:text="PASSWORD"
app:layout_constraintStart_toStartOf="@+id/textView3"
app:layout_constraintTop_toBottomOf="@+id/textView3" />

<EditText android:id="@+id/txt_username" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:layout_marginStart="40dp"
android:layout_marginEnd="10dp" android:ems="10" android:inputType="textPersonName"
app:layout_constraintBottom_toBottomOf="@+id/textView3"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@+id/textView3"
app:layout_constraintTop_toTopOf="@+id/textView3" />

<EditText android:id="@+id/txt_password" android:layout_width="0dp" android:layout_height="40dp"


android:layout_marginTop="26dp" android:ems="10" android:inputType="textPassword"
app:layout_constraintEnd_toEndOf="@+id/txt_username"
app:layout_constraintStart_toStartOf="@+id/txt_username"
app:layout_constraintTop_toBottomOf="@+id/txt_username" />

<Button android:id="@+id/btn_signup" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:layout_marginTop="30dp" android:text="Sign Up"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txt_password" />
</androidx.constraintlayout.widget.ConstraintLayout>

Activity_login.xml

<?xml version="1.0" encoding="utf-8"?>


<androidx.constraintlayout.widget.ConstraintLayoutxmlns:android="http://schemas.andr
oid.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="match_parent"
tools:context=".LoginActivity">

<TextView android:id="@+id/textView7" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:layout_marginTop="50dp" android:text="Login"
android:textSize="22dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView android:id="@+id/textView9" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:layout_marginStart="30dp"
android:layout_marginTop="50dp" android:text="Username"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/textView7"
/>

Page 11
Mobile Application Development Lab (18CSMP68)

<EditText android:id="@+id/txt_login_username" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:layout_marginStart="20dp"
android:layout_marginEnd="20dp" android:ems="10" android:inputType="textPersonName"
app:layout_constraintBottom_toBottomOf="@+id/textView9"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@+id/textView9"
app:layout_constraintTop_toTopOf="@+id/textView9" />

<TextView android:id="@+id/textView10" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:layout_marginStart="30dp"
android:layout_marginTop="50dp"
android:text="PASSWORD" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView9" />

<EditText android:id="@+id/txt_login_password" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:ems="10" android:inputType="textPassword"
app:layout_constraintEnd_toEndOf="@+id/txt_login_username"
app:layout_constraintStart_toStartOf="@+id/txt_login_username"
app:layout_constraintTop_toTopOf="@+id/textView10" />

<Button android:id="@+id/btn_login_signin" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:layout_marginTop="50dp" android:text="Login"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txt_login_password" />
</androidx.constraintlayout.widget.ConstraintLayout>

MainActivity.java

package com.example.parta.program3;
import androidx.appcompat.app.AppCompatActivity; import android.content.Intent;
import android.os.Bundle;
import android.view.View; import android.widget.Button; import android.widget.EditText; import
android.widget.Toast;
import java.util.regex.Matcher; import java.util.regex.Pattern;
public class MainActivityextends AppCompatActivityimplements View.OnClickListener {
EditTexttxtUsername;
EditTexttxtPassword;

Button btnSignup;
String regularExpression="^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)(?=.*[@$!])[A-Za- z\\d@$!]{8,}$";

@Override

Page 12
Mobile Application Development Lab (18CSMP68)

protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);


setContentView(R.layout.activity_main); txtUsername=(EditText)findViewById(R.id.txt_username);
txtPassword=(EditText)findViewById(R.id.txt_password);

btnSignup=(Button)findViewById(R.id.btn_signup); btnSignup.setOnClickListener(this);

public void onClick(View v)


{
String username=txtUsername.getText().toString(); String password=txtPassword.getText().toString();

if(validatePassword(password)) { Bundle bundle = new Bundle(); bundle.putString("user", username);


bundle.putString("Lab@2018", password);

Intent it = new Intent(this, LoginActivity.class); it.putExtra("data", bundle);


else
{
startActivity(it);
}

Toast.makeText(getBaseContext(), "Invalid Password", Toast.LENGTH_LONG).show();


}
}

public booleanvalidatePassword(String password)


{
Pattern pattern= Pattern.compile(regularExpression); Matcher matcher=pattern.matcher(password);
return matcher.matches();
}
}

LoginActivity.java

package com.example.parta.program3;

import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle;


import android.view.View; import android.widget.Button; import android.widget.EditText; import
android.widget.Toast;
public class LoginActivityextends AppCompatActivityimplements View.OnClickListener {
EditTexttxtLoginUsername;
EditTexttxtLoginPassword;
Button btnLogin; String user,pass;
int count=0;

Page 13
Mobile Application Development Lab (18CSMP68)

@Override
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);

txtLoginUsername=(EditText) findViewById(R.id.txt_login_username); txtLoginPassword=(EditText)


findViewById(R.id.txt_login_password);

btnLogin=(Button)findViewById(R.id.btn_login_signin); btnLogin.setOnClickListener(this);

Bundle bundle=getIntent().getBundleExtra("data"); user=bundle.getString("user");


pass=bundle.getString("Lab@2018");
}

public void onClick(View v)


{
String user1=txtLoginUsername.getText().toString(); String
pass1=txtLoginPassword.getText().toString();

if(user.equals(user1)&&pass.equals(pass1))
{
Toast.makeText(this,"Login Successful"
,Toast.LENGTH_LONG).show();
}
else

{
count++; if(count==3)
{
btnLogin.setEnabled(false); Toast.makeText(this, "Failed Login Attempts"
,Toast.LENGTH_LONG).show();
}
else
{
Toast.makeText(this,"Login Failed "+count
,Toast.LENGTH_LONG).show();
}
}
}
}

Page 14
Mobile Application Development Lab (18CSMP68)

Sample Output

Page 15
Mobile Application Development Lab (18CSMP68)

4) Develop an application to set an image as wallpaper. On click of a button, the wallpaper


image should start to change randomly every 30 seconds.

MainActivity.java

package com.example.wallpaper;

import androidx.appcompat.app.AppCompatActivity;

import android.app.WallpaperManager;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import java.util.Random;
import java.util.Timer;
import java.util.TimerTask;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

Boolean running=false;
Button chnge;
int i = 1;
int[] images = new int[]{R.drawable.imga, R.drawable.imgb,
R.drawable.imgc, R.drawable.imgd,
R.drawable.imge, R.drawable.imgf};

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

chnge = (Button) findViewById(R.id.chng);


chnge.setOnClickListener(this);
}

@Override
public void onClick(View view) {
if (!running) {
new Timer().schedule(new MyTimer(), 0, 3000);
running = false;
}

Page 16
Mobile Application Development Lab (18CSMP68)

class MyTimer extends TimerTask {


public void run() {
try {
WallpaperManager wallpaperManager = WallpaperManager.getInstance(getBaseContext());
Random rand = new Random();
i = rand.nextInt(6);

wallpaperManager.setBitmap(BitmapFactory.decodeResource(getResources(), images[i]));
} catch (Exception e) {
}
}
}
}

Activity_main.xml

<?xml version="1.0" encoding="utf-8"?>


<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F6E8BF"
tools:context=".MainActivity">
<Button
android:id="@+id/chng"
android:layout_width="237dp"
android:layout_height="104dp"
android:background="#E8BC39"
android:text="Click here To Change Wallpaper"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.497"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.515" />
<TextView
android:id="@+id/textView"
android:layout_width="376dp"
android:layout_height="58dp"
android:fontFamily="casual"

Page 17
Mobile Application Development Lab (18CSMP68)

android:text="CHANGING WALLPAPER APPLICATION”


android:textColor="#009688"
android:textSize="20sp"
android:textStyle="bold|italic"
app:layout_constraintBottom_toTopOf="@+id/chng"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.501" />
</androidx.constraintlayout.widget.ConstraintLayout>

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>


<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.wallpaper">
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application></manifest>

Page 18
Mobile Application Development Lab (18CSMP68)

Page 19
Mobile Application Development Lab (18CSMP68)

5) Write a program to create an activity with two buttons START and STOP. On pressing of the
START button, the activity must start the counter by displaying the numbers from One and the
counter must keep on counting until the STOP button is pressed. Display the counter value in a
TextViewcontrol.

MainActivity.java

package com.example.counter;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {


TextView count;
Button start,stop;
int counter=0;
boolean running = false;
String
url="https://media1.tenor.com/images/142ffb3aa784ee74e9ce08b57edc89c6/tenor.gif?itemid=5301252
";

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
count=(TextView)findViewById(R.id.count);
start=(Button)findViewById(R.id.startbtn);
stop=(Button)findViewById(R.id.stopbtn);
start.setOnClickListener(this);
stop.setOnClickListener(this);

}
@Override

Page 20
Mobile Application Development Lab (18CSMP68)

public void onClick(View view)


{
if(view.equals(start))
{
counter=0;
running=true;

new MyCounter().start();
}
else
running=false;
}
Handler handler= new Handler(){
public void handleMessage(Message counter)
{
count.setText(String.valueOf(counter.what));
}};
class MyCounter extends Thread
{
public void run()
{
while(running)
{

counter++;
handler.sendEmptyMessage(counter);
try{
Thread.sleep(100);
}
catch(Exception e){}
}
}
}
}

Activity_main.xml

<?xml version="1.0" encoding="utf-8"?>


<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"

Page 21
Mobile Application Development Lab (18CSMP68)

android:background="#EBB8F4"
tools:context=".MainActivity">

<TextView
android:id="@+id/heading"
android:layout_width="381dp"
android:layout_height="61dp"
android:fontFamily="casual"
android:gravity="center"
android:text="COUNTER APPLICATION"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textColor="#4E1B57"
android:textStyle="bold|italic"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.41"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.073" />

<Button
android:id="@+id/startbtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="144dp"
android:background="#8D15A1"
android:fontFamily="casual"
android:text="START"
android:textColor="#FAF6F6"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.507"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/heading" />

<EditText
android:id="@+id/count"
android:layout_width="79dp"
android:layout_height="80dp"
android:layout_marginStart="164dp"
android:layout_marginTop="152dp"
android:ems="10"
android:fontFamily="sans-serif-black"
android:gravity="center"
android:inputType="textPersonName"

Page 22
Mobile Application Development Lab (18CSMP68)

android:textColor="#2A0630"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<Button
android:id="@+id/stopbtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="172dp"
android:background="#781A88"
android:fontFamily="casual"
android:text="STOP"
android:textColor="#FAF6F6"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.535"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/startbtn"
app:layout_constraintVertical_bias="0.186" />

</androidx.constraintlayout.widget.ConstraintLayout>

Page 23
Mobile Application Development Lab (18CSMP68)

6) Create two files of XML and JSON type with values for City_Name, Latitude, Longitude,
Temperature, and Humidity. Develop an application to create an activity with two buttons to
parse the XML and JSON files which when clicked should display the data in their respective
layouts side by side.

activity_main.xml

<?xml version="1.0" encoding="utf-8"?>


<androidx.constraintlayout.widget.ConstraintLayoutxmlns:android="http://schemas.andr
oid.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="match_parent"
tools:context=".MainActivity">

<Button android:id="@+id/btn_parsexml" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:layout_marginTop="80dp" android:text="Parse XML
Data"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView4" />

<Button android:id="@+id/btn_parsejson" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:layout_marginTop="80dp" android:text="Parse Json
Data"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btn_parsexml" />

<TextView android:id="@+id/textView4" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:layout_marginTop="40dp"
android:text="PARSING XML AND JSON DATA" android:textSize="20dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

Page 24
Mobile Application Development Lab (18CSMP68)

activity_view.xml

<?xml version="1.0" encoding="utf-8"?>


<androidx.constraintlayout.widget.ConstraintLayoutxmlns:android="http://schemas.andr
oid.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="match_parent"
tools:context=".ViewActivity">

<TextView android:id="@+id/lbl_xml_data" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:layout_marginTop="30dp" android:text="Xml Data"
app:layout_constraintStart_toStartOf="@+id/textView2"
app:layout_constraintTop_toBottomOf="@+id/textView2" />

<TextView android:id="@+id/textView" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:layout_marginTop="40dp" android:text="PARSING XML
AND JSON DATA" android:textSize="20dp" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" />

<TextView android:id="@+id/textView2" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:layout_marginStart="40dp"
android:layout_marginTop="20dp" android:text="XML DATA"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/textView"
/>

<TextView android:id="@+id/textView3" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:layout_marginTop="20dp"
android:layout_marginEnd="40dp" android:text="JSON DATA"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toBottomOf="@+id/textView" />

<TextView android:id="@+id/lbl_json_data" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:layout_marginTop="30dp" android:text="Json Data"
app:layout_constraintEnd_toEndOf="@+id/textView3"
app:layout_constraintTop_toBottomOf="@+id/textView3" />
</androidx.constraintlayout.widget.ConstraintLayout>

MainActivity.java
package com.example.parta_program6;
import androidx.appcompat.app.AppCompatActivity; import android.content.Intent;
import android.os.Bundle; import android.view.View; import android.widget.Button;

public class MainActivityextendsAppCompatActivityimplementsView.OnClickListener { Button


btnParseXml,btnParseJson;
@Override

Page 25
Mobile Application Development Lab (18CSMP68)

protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);


setContentView(R.layout.activity_main); btnParseXml=(Button)findViewById(R.id.btn_parsexml);
btnParseJson=(Button)findViewById(R.id.btn_parsejson); btnParseJson.setOnClickListener(this);
btnParseXml.setOnClickListener(this);
}

@Override
public void onClick(View v) {

if(v.equals(btnParseJson))
{
Intent it=new Intent(this,ViewActivity.class); it.putExtra("mode",1);
startActivity(it);

}
else if(v.equals(btnParseXml))
{
Intent it=new Intent(this,ViewActivity.class); it.putExtra("mode",2);
startActivity(it);
}
}
}

ViewActivity.java
package com.example.parta_program6;
import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle;
import android.widget.TextView;

import org.json.JSONObject; import org.w3c.dom.Document; import org.w3c.dom.Element; import


org.w3c.dom.Node; import org.w3c.dom.NodeList;

import java.io.InputStream;

import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory;

public class ViewActivityextendsAppCompatActivity { TextViewlblXmlData,lblJsonData;


int mode=0; @Override
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.activity_view); lblXmlData=(TextView)findViewById(R.id.lbl_xml_data);
lblJsonData=(TextView)findViewById(R.id.lbl_json_data); mode=getIntent().getIntExtra("mode",0);

if(mode==1) parseJson();

else parseXmlDocument();

Page 26
Mobile Application Development Lab (18CSMP68)

public String parseXmlDocument()


{
try {

InputStream is = getAssets().open("input.xml");

DocumentBuilderFactorydbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilderdBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(is);

Element element=doc.getDocumentElement(); element.normalize();

NodeListnList = doc.getElementsByTagName("employee"); for (int i=0; i<nList.getLength(); i++) {


Node node = nList.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) { Element element2 = (Element) node;
lblXmlData.setText("City Name : " + getValue("city_name", element2)+"\n");
lblXmlData.append("Latitude : " + getValue("Latitude", element2)+"\n"); lblXmlData.append("Longitude :
" + getValue("Longitude", element2)+"\n"); lblXmlData.append("Temperature : " +
getValue("Temperature", element2)+"\n"); lblXmlData.append("Humidity : " + getValue("Humidity",
element2)+"\n");
}
}
}
catch (Exception e) {e.printStackTrace();} return null;
}

private static String getValue(String tag, Element element) { NodeListnodeList =


element.getElementsByTagName(tag).item(0).getChildNodes(); Node node = nodeList.item(0);
return node.getNodeValue();
}

public void parseJson()


{
try { InputStreaminputStream=getAssets().open("input.json"); byte[] data=new
byte[inputStream.available()]; inputStream.read(data);

String readData=new String(data); JSONObjectjsonObject=new JSONObject(readData);


JSONObject jsonObject1=jsonObject.getJSONObject("employee"); lblJsonData.setText("City
Name:"+jsonObject1.getString("city_name")+"\n");
lblJsonData.append("Latitude:"+jsonObject1.getString("Latitude")+"\n");
lblJsonData.append("Longitude"+jsonObject1.getString("Longitude")+"\n");

Page 27
Mobile Application Development Lab (18CSMP68)

lblJsonData.append("Temperature:"+jsonObject1.getInt("Temperature")+"\n");
lblJsonData.append("Humidity"+jsonObject1.getString("Humidity")+"\n");
}
catch (Exception e) {e.printStackTrace();}
}
}

Page 28
Mobile Application Development Lab (18CSMP68)

7) Develop a simple application withoneEditTextso that the user can write some text in it. Create
a button called “Convert Text to Speech” that converts the user input text into voice.

MainActivity.java

package com.example.lab7;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import java.util.Locale;

public class MainActivity extends AppCompatActivity implements View.OnClickListener


{
EditText input;
Button btn;
TextToSpeech tts;

@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
input =(EditText)findViewById(R.id.input);
btn=(Button)findViewById(R.id.submit);
btn.setOnClickListener(this);
tts=new TextToSpeech(getBaseContext(), new TextToSpeech.OnInitListener() {
@Override
public void onInit(int i) {
if(i!=TextToSpeech.ERROR)
Toast.makeText(getBaseContext(), "Success", Toast.LENGTH_LONG).show();
}
});
tts.setLanguage(Locale.ENGLISH);

@Override
public void onClick(View view) {

Page 29
Mobile Application Development Lab (18CSMP68)

String text=input.getText().toString();
tts.speak(text,TextToSpeech.QUEUE_FLUSH,null);
}
}

Activity_main.xml

<?xml version="1.0" encoding="utf-8"?>


<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:background="@drawable/damien_hirst_dot">

<TextView
android:id="@+id/textView"
android:layout_width="369dp"
android:layout_height="90dp"
android:fontFamily="cursive"
android:gravity="center"
android:text="Text to Speech Converter"
android:textColor="#C51FE1"
android:textSize="36sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.446"
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.134" />

<EditText
android:id="@+id/input"
android:layout_width="383dp"
android:layout_height="168dp"
android:background="#F4EBEB"
android:ems="10"
android:gravity="center"

Page 30
Mobile Application Development Lab (18CSMP68)

android:inputType="textPersonName"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.571"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView"
app:layout_constraintVertical_bias="0.271" />

<Button
android:id="@+id/submit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#BB1BD6"
android:text="Convert Text to Speech"
android:textColor="#FAF6F6"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/input" />

</androidx.constraintlayout.widget.ConstraintLayout>

Page 31
Mobile Application Development Lab (18CSMP68)

8) Create an activity like a phone dialer with CALL and SAVE buttons. On pressing the CALL
button, it must call the phone number and on pressing the SAVE button it must save the
number to the phone contacts.

activity_main.xml

<?xml version="1.0" encoding="utf-8"?>


<androidx.constraintlayout.widget.ConstraintLayoutxmlns:android="http://schemas.andr
oid.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="match_parent"
tools:context=".MainActivity">

<TextView android:id="@+id/textView" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:layout_marginTop="50dp" android:text="PHONE
DAILER" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<EditText android:id="@+id/txt_phonenumber" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:layout_marginStart="20dp"
android:layout_marginTop="30dp" android:ems="10" android:inputType="textPersonName"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/textView"
/>

<Button android:id="@+id/btn_delete" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:layout_marginStart="20dp"
android:layout_marginTop="30dp" android:text="Delete"
app:layout_constraintStart_toEndOf="@+id/txt_phonenumber"
app:layout_constraintTop_toBottomOf="@+id/textView" />

<Button android:id="@+id/btn_one"

Page 32
Mobile Application Development Lab (18CSMP68)

android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="20dp" android:layout_marginTop="30dp" android:text="1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txt_phonenumber" />

<Button android:id="@+id/btn_two"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="30dp" android:text="2"
app:layout_constraintEnd_toStartOf="@+id/btn_three"
app:layout_constraintStart_toEndOf="@+id/btn_one"
app:layout_constraintTop_toBottomOf="@+id/txt_phonenumber" />

<Button android:id="@+id/btn_three"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="30dp" android:layout_marginEnd="20dp" android:text="3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txt_phonenumber" />

<Button android:id="@+id/btn_four"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="20dp" android:layout_marginTop="30dp" android:text="4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btn_one" />

<Button android:id="@+id/btn_five"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="30dp" android:text="5"
app:layout_constraintEnd_toStartOf="@+id/btn_six"
app:layout_constraintStart_toEndOf="@+id/btn_four"
app:layout_constraintTop_toBottomOf="@+id/btn_two" />

<Button android:id="@+id/btn_six"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="30dp" android:layout_marginEnd="20dp" android:text="6"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btn_three" />

<Button android:id="@+id/btn_seven"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="20dp" android:layout_marginTop="30dp" android:text="7"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btn_four" />

<Button android:id="@+id/btn_eight"

Page 33
Mobile Application Development Lab (18CSMP68)

android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="8" app:layout_constraintEnd_toStartOf="@+id/btn_nine"
app:layout_constraintStart_toEndOf="@+id/btn_seven"
app:layout_constraintTop_toBottomOf="@+id/btn_five" />

<Button android:id="@+id/btn_nine"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="30dp" android:layout_marginEnd="20dp" android:text="9"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btn_six" />

<Button android:id="@+id/btn_zero"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="30dp" android:text="0" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btn_eight" />

<Button android:id="@+id/btn_call"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="20dp" android:layout_marginTop="30dp" android:text="Call"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btn_zero" />

<Button android:id="@+id/btn_save"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="30dp" android:layout_marginEnd="20dp" android:text="Save"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btn_zero" />

<Button android:id="@+id/btn_start"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="20dp" android:layout_marginTop="30dp" android:text="*"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btn_seven" />

<Button android:id="@+id/btn_hash"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="30dp" android:layout_marginEnd="20dp" android:text="#"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btn_nine" />
</androidx.constraintlayout.widget.ConstraintLayout>

MainActivity.java

Page 34
Mobile Application Development Lab (18CSMP68)

package com.example.part_a_program_8;

import androidx.appcompat.app.AppCompatActivity; import android.content.Intent;


import android.net.Uri; import android.os.Bundle;
import android.provider.ContactsContract; import android.view.View;
import android.widget.Button; import android.widget.EditText;
public class MainActivityextends AppCompatActivityimplements View.OnClickListener{ Button
btnOne,btnTwo,btnThree,btnFour,btnFive;
Button btnSix,btnSeven,btnEight,btnNine,btnZero; Button btnDel,btnStar,btnHash,btnCall,btnSave;
EditTexttxtPhonenumber; @Override
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

btnOne=(Button)findViewById(R.id.btn_one); btnOne.setOnClickListener(this);
btnTwo=(Button)findViewById(R.id.btn_two); btnTwo.setOnClickListener(this);
btnThree=(Button)findViewById(R.id.btn_three); btnThree.setOnClickListener(this);
btnFour=(Button)findViewById(R.id.btn_four); btnFour.setOnClickListener(this);
btnFive=(Button)findViewById(R.id.btn_five); btnFive.setOnClickListener(this);
btnSix=(Button)findViewById(R.id.btn_six); btnSix.setOnClickListener(this);
btnSeven=(Button)findViewById(R.id.btn_seven); btnSeven.setOnClickListener(this);
btnEight=(Button)findViewById(R.id.btn_eight); btnEight.setOnClickListener(this);
btnNine=(Button)findViewById(R.id.btn_nine); btnNine.setOnClickListener(this);
btnZero=(Button)findViewById(R.id.btn_zero); btnZero.setOnClickListener(this);
btnStar=(Button)findViewById(R.id.btn_start); btnStar.setOnClickListener(this);
btnHash=(Button)findViewById(R.id.btn_hash); btnHash.setOnClickListener(this);
btnCall=(Button)findViewById(R.id.btn_call); btnCall.setOnClickListener(this);
btnSave=(Button)findViewById(R.id.btn_save); btnSave.setOnClickListener(this);
btnDel=(Button)findViewById(R.id.btn_delete); btnDel.setOnClickListener(this);
txtPhonenumber=(EditText)findViewById(R.id.txt_phonenumber); txtPhonenumber.setText("");
}

public void onClick(View v)


{
if(v.equals(btnOne)) txtPhonenumber.append("1");

else if(v.equals(btnTwo)) txtPhonenumber.append("2");

else if(v.equals(btnThree)) txtPhonenumber.append("3");

else if(v.equals(btnFour)) txtPhonenumber.append("4");

else if(v.equals(btnFive)) txtPhonenumber.append("5");

else if(v.equals(btnSix)) txtPhonenumber.append("6");

Page 35
Mobile Application Development Lab (18CSMP68)

else if(v.equals(btnSeven)) txtPhonenumber.append("7");

else if(v.equals(btnEight)) txtPhonenumber.append("8");

else if(v.equals(btnNine)) txtPhonenumber.append("9");

else if(v.equals(btnZero)) txtPhonenumber.append("0");

else if(v.equals(btnStar)) txtPhonenumber.append("*");

else if(v.equals(btnHash)) txtPhonenumber.append("#");

else if(v.equals(btnSave))
{
Intent contactIntent= new Intent
(ContactsContract.Intents.Insert.ACTION); contactIntent.setType
(ContactsContract.RawContacts.CONTENT_TYPE);
contactIntent.putExtra(ContactsContract.Intents.Insert.NAME,"Unknown");
contactIntent.putExtra(ContactsContract.Intents.Insert.PHONE, txtPhonenumber.getText().toString());
startActivity(contactIntent);
}
else if(v.equals(btnDel))
{
String data=txtPhonenumber.getText().toString(); if(data.length()>0)
{
txtPhonenumber.setText
(data.substring(0,data.length()-1));
}
else
{
txtPhonenumber.setText("");
}
}

btnCall.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v) {
String data = txtPhonenumber.getText().toString(); Intent intent=new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse("tel:"+ data)); startActivity(intent);
}
}
);
}

Page 36
Mobile Application Development Lab (18CSMP68)

AndriodManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.part_a_program_8">
<uses-permission android:name="android.permission.CALL_PHONE"/>
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

Sample Output

Page 37

You might also like