Practical - FY - MAD - 1 To 3

Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

G.S.

Mandal’s
Maharashtra Institute of Technology, Aurangabad
Department of Basic Sciences and Humanities

LAB MANUAL
ESC255 Mobile Application Development
(2022-23 Part II)

Maharashtra Institute of Technology, Aurangabad


NH-211, MIT Campus, Satara Village Road, Aurangabad- 431
010 (M.S.); India. Phone: (0240) 2375222; Fax: (0240)
2376618, E-mail: principalmitt@mit.asia Website:
www.btech.mit.asia
Program Outcomes
PO1: Apply knowledge of mathematics, science, and engineering fundamentals to solve problems in
Computer science and Engineering.
PO2: Identify, formulate and analyze complex problems.

PO3: Design system components or processes to meet the desired needs within realistic constraints for the
public health and safety, cultural, societal and environmental considerations.
PO4: Use research-based knowledge and research methods including design of experiments, analysis and
interpretation of data for valid conclusions.
PO5: Select and apply modern engineering tools to solve the complex engineering problem.
PO6: Apply knowledge to assess contemporary issues.

PO7: Understand the impact of engineering solutions in a global, economic, environmental, and societal
context.
PO8: Apply ethical principles and commit to professional ethics and
responsibilities.
PO9: Work effectively as an individual, and as a member or leader in diverse teams and in
multidisciplinary settings.
PO10: Communicate effectively in both verbal and written form.

PO11: Demonstrate knowledge and apply engineering and management


principles to manage projects and in multi-disciplinary environment.
PO12: To engage in life-long learning to adapt to the technological changes.

i
Course: ESC255: Lab-II: Mobile Application Development
Course Outcomes:
After Completing the course students will be able to

Explain Android Ecosystem and android operating System.


CO 1

Configure Android Environment and development tools.


CO 2

Use different layout and control flow for designing user Interface.
CO 3

CO 4 Design user interface using different UI components of Android. (III. Apply)

CO 5 Demonstrate different lifecycles in Android (III. Apply)

Illustrate the process of publishing an android app on google play store. (III. Apply)
CO 6

ii
List of Experiment

Any 10 practical to be conducted

1. Compare various Operating System with Android Operating System

2. Install Java Development Kit (JDK), Android Studio and Android SDK

3. Develop an application to display HelloWorld

4. Develop an application to implement Text View, Button and Edit Text

5. Develop an application to implement Radio Button & Progress Bar

6. Develop an application to implement Linear Layout and Relative Layout

7. Develop an application to implement Date and Time Picker

8. Develop an application to implement custom Toast Alert

9. Develop an application to implement Calculator

10. Develop an application to implement Content Provider

11. Develop an application to Send SMS

12. Develop an application with login module to check username and password.
On successful login open another activity with welcome message otherwise
show invalid login.

Course Coordinator: Ms. A R Kothimbire 3 Approved By:HEAD BSH


EXPERIMENT NO :1

AIM: Compare various Operating System with Android Operating System.

OBJECTIVE: The objective is to:

1. Get familiar with different operating systems with similarities and differences.

2. To list the features of Android operating system and others.

OUTCOMES: After completing the Experiment 1students will be able to:

1. Understand different operating systems and their parameters.

PRE-REQUISITES: Basics of operating system.

THEORY:

Features of Android

1. Android is a powerful open-source operating system that open-source provides immense features
and some of these are listed below.
2. Android Open-Source Project so we can customize the OS based on our requirements.
3. Android supports different types of connectivity for GSM, CDMA, Wi-Fi, Bluetooth, etc. for
telephonic conversation or data transfer.
4. Using WIFI technology we can pair with other devices while playing games or using other
applications.
5. It contains multiple APIs to support location-tracking services such as GPS.
6. We can manage all data storage-related activities by using the file manager.
7. It contains a wide range of media supports like AVI, MKV, FLV, MPEG4, etc. to play or record a
variety of audio/video.
8. It also supports different image formats like JPEG, PNG, GIF, BMP, MP3, etc.
9. It supports multimedia hardware control to perform playback or recording using a camera and
microphone.
10. Android has an integrated open-source Web Kit layout-based web browser to support User
Interfaces like HTML5, and CSS3.
11. Android supports multi-tasking means we can run multiple applications at a time and can switch
between them.
12. It provides support for virtual reality or 2D/3D Graphics.

Course Coordinator: Ms. A R Kothimbire 4 Approved By:HEAD BSH


Comparison of Android with other operating systems:

Features Android iOS Windows


1. Developer Google Apple Microsoft
2 Language Java, some part of code in C, C++ C .Net, C#
3 Initial release 2008 2007 2000 for mobile
year
4 Licences Apache Licence 2.0 Cisco Commercial
proprietary software
5 Source model Open-Source Software Not open source Not open source
6 Applications Created by open community Apple develops and Created my tie up
developers maintains Microsoft companies
7 Development Ecllipse, IntelliJ IDEA, Android Xcode only on Mac Visual studio only on
tool Studio, Flutter windows
8 1st 3rd 2nd
Affordability
9 Applications 2nd 3rd 1st
speed

10 App store 2nd 3rd 1st


usability
11 Battery life 1st 3rd 2nd
management
12 Os updates 2nd 3rd 1st
13 Application Android Package file apk Ipa Cab/XAP/APPX
packaging
14 Development Free Tools free but Visual Studio Cost
cost needs Publisher
account
15 App publisher Google play, Amazon Store, Apple Store Windows Store
Samsung Store, F-Droid, AppsLib
etc

16 Database Local SQL database Support Local SQL Local SQL database
support database Support Support
17 Publisher 25-dollar onetime payment 99 dollar per year 19 dollar per year
account cost
Course Coordinator: Ms. A R Kothimbire 5 Approved By:HEAD BSH
18 Time taken by 2 Hours 2 weeks 2 weeks
app to be
visible in app
store
19 Latest os Android 13.0 iOS 16.4 Windows 10 mobile
version
20 Memory usage High Low High
21 Interface User Friendly User Friendly Not user Friendly

ASSESSMENT QUESTIONS:

1. List different Android O.S. versions.

Answer:
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________

2. State tools used for android application development.

Answer:
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
3. What are the layers of android architecture, list their importance and in which layer app resides?

Answer:
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________

Course Coordinator: Ms. A R Kothimbire 6 Approved By:HEAD BSH


EXPERIMENT NO: 2

AIM: Install Java Development Kit (JDK), Android Studio and Android SDK.

OBJECTIVE: The objective of this experiment is:

1. Configure system for android application development.


2. Make students aware of installation of JDK, Android Studio and Android SDK.

OUTCOMES:
• After completing the Experiment#2 students will be able to:
1. Understand steps in installation of JDK and Android Studio.
• 2. Make machine ready for will all the configured settings for android application
development.

PRE-REQUISITES:
1. Windows operating system.
2. Basics of Android operating system.

THEORY:

Install JDK on Microsoft Windows

Step 1: Download and Install Java Development Kit (JDK)


The very first step is to download the Oracle Java Development Kit (JDK) from the Official Oracle
Website:
https://www.oracle.com/java/technologies/downloads/#jdk18-windows

You need to identify your system specifications to choose the Product/file description. The website will
contain the latest version for your corresponding system. For Windows, we’ll be downloading the
latest x64 Installer of Java SE Development Kit 18. After the download is complete, proceed to
install the JDK by following the bootstrapped steps.

Course Coordinator: Ms. A R Kothimbire 7 Approved By:HEAD BSH


Step 2: Configure Environment Variables

Course Coordinator: Ms. A R Kothimbire 8 Approved By:HEAD BSH


After the installation is complete, we have to configure environment variables to notify the system
about the directory in which JDK files are located. Proceed to C:\Program Files\Java\jdk-
{YOUR_JDK_VERSION} \bin (replace {-} with your JDK version)

To set the Environment Variables, you need to search Environment Variables in the Task Bar and click
on “Edit the system environment variables”.

Course Coordinator: Ms. A R Kothimbire 9 Approved By:HEAD BSH


Under the Advanced section, Click on “Environment Variables”

Course Coordinator: Ms. A R Kothimbire 10 Approved By:HEAD BSH


Under System variables, select the “Path” variable and click on “Edit”. Click on “New” then paste
the Path Address i.e. C:\Program Files\Java\jdk- {YOUR_JDK_VERSION} \bin. Click on “OK”.

Course Coordinator: Ms. A R Kothimbire 11 Approved By:HEAD BSH


Step 3: Check the Java Version
Open Command Prompt and enter the following commands

Course Coordinator: Ms. A R Kothimbire 12 Approved By:HEAD BSH


Install Android Studio

To install Android Studio on Windows, follow these steps:

Do you want to allow this app to make changes to your device? Click yes for this window. Then the next
window comes.

Course Coordinator: Ms. A R Kothimbire 13 Approved By:HEAD BSH


Click next,

Select “Android Virtual Device” and click next, it will ask the path as in next shown window,
Select it by default and click next as in following window.

Course Coordinator: Ms. A R Kothimbire 14 Approved By:HEAD BSH


Following window appears

Click Install, following window appears and installation starts,

Course Coordinator: Ms. A R Kothimbire 15 Approved By:HEAD BSH


After completing click finish in the following window:

Click finish in following window:

Course Coordinator: Ms. A R Kothimbire 16 Approved By:HEAD BSH


Now your machine is ready for android application development.

Steps to install Android SDK:


 After completion of android studio installation, A window comes select default settings, for text
and window color i.e.. White and black text, click next, now android studio starts installing
Android tools after completion click finish. Finally, a welcome screen appears where to make
new android studio project.
 We can do to android SDK settings -> SDK manager->In that we can install tools, Platforms and
updates.
 Create emulators by Tools->Android->AVD manager->create device ->select pixel size ->
Versions ->next -> Finish.
Now you can select your created device and click green play button to run different emulators on AVD.

Course Coordinator: Ms. A R Kothimbire 17 Approved By:HEAD BSH


Course Coordinator: Ms. A R Kothimbire 18 Approved By:HEAD BSH
ASSESSMENT QUESTIONS:

1. What is AVD?

Answer:______________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________

2. What is emulator

Answer:______________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________

3. Why Installation of JDK is important before Android Studio Installation?

Answer:______________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________

Course Coordinator: Ms. A R Kothimbire 19 Approved By:HEAD BSH


EXPERIMENT NO: 3

AIM: Develop an application for displaying “Hello world”.

OBJECTIVE: The objective of this experiment is:

3. Create a most basic project in Android Studio using java.


4. Run the project on AVD and understand the steps to create emulation devices.

OUTCOMES:
After completing the Experiment#2 students will be able to:
1. Understand steps of project creation in Android Studio.
2. Understand Android studio tool tabs and button function.
3. Able to run the ready project and see the emulation output on emulator.

PRE-REQUISITES:
1. Understanding of Android Studio.
2. Basics of Coding and Drag drop tool based GUI designing.

THEORY:

1. Steps For Creating a new project:

Open Android Studio(Flamingo Version)

File --> new project -->select Phone and Tablet --> select Empty View Activity --> Click Next

Course Coordinator: Ms. A R Kothimbire 20 Approved By:HEAD BSH


Following window appears:

1. In the next window, enter Hello World for the Name.


2. Accept the default com.example.helloworld for the Package name, or create a unique package
name. If you are not planning to publish your app, you can accept the default. Be aware that
changing the package name of your app later is extra work.

Course Coordinator: Ms. A R Kothimbire 21 Approved By:HEAD BSH


3. Verify that the default Save location is where you want to store your Hello World app and other
Android Studio projects, or change it to your preferred directory.
4. Ensure that the selected language is Java; if it is not, use the dropdown menu to set it.
5. Ensure that API 21: Android 5.0 (Lollipop) is set as the Minimum SDK; if it is not, use the
dropdown menu to set it.
6. Check the option to Use legacy android.support libraries (Note: newer codelabs will leave this
unchecked). As of this writing, these settings make your Hello World app compatible with 98%
of Android devices active on the Google Play store.
7. Click Finish

Android Studio creates a folder for your projects, and builds the project with Gradle (this may take a few
minutes).

Following Andriod Studio Editor window will appear.

Just wait and don’t click anywhere ,a new window will automatically appear with avtivity_main.xml and
MainActivity.java tabs.
The Android Studio editor appears. Follow these steps:
Click the activity_main.xml tab to see the layout editor.
Click the layout editor Design tab, if not already selected, to show a graphical rendition of the layout as
shown below.
Click the MainActivity.java tab to see the code editor as shown below.

2. Explore the Project > Android pane


In this practical, you will explore how the project is organized in Android Studio.
If not already selected, click the Project tab in the vertical tab column on the left side of the Android
Studio window. The Project pane appears.
To view the project in the standard Android project hierarchy, choose Android from the dropdown menu
at the top of the Project pane, as shown below.

Course Coordinator: Ms. A R Kothimbire 22 Approved By:HEAD BSH


3. Explore the Gradle Scripts folder

The Gradle build system in Android Studio makes it easy to include external binaries or other library
modules to your build as dependencies.

When you first create an app project, the Project > Android pane appears with the Gradle Scripts folder
expanded as shown below.

Follow these steps to explore the Gradle system:

1. If the Gradle Scripts folder is not expanded, click the arrow to expand it.This folder contains all
the files needed by the build system.
2. Look for the settings.gradle (Project Settings) file.

Course Coordinator: Ms. A R Kothimbire 23 Approved By:HEAD BSH


This is where you'll find the project-level repository settings and the modules to include when building
your app. The Gradle settings file is part of the standard project structure for an Android app. Most of the
time, you won't need to make any changes to this file, but it's still useful to understand its contents.

By default, the settings file uses the pluginManagement block to configure the repositories Gradle uses to
search or download the Gradle plugins and their transitive dependencies.
The dependencyResolutionManagement block configures the repositories and dependencies used by all
modules in your project, such as libraries that you are using to create your application. When your
dependency is something other than a local library or file tree, Gradle looks for the files in whichever
online repositories are specified in the repositories block of this file. By default, new Android Studio
projects declare MavenCentral and Google (which includes the Google Maven repository) as the
repository locations:

4. Explore the app and res folders

All code and resources for the app are located within the app and res folders.

1. Expand the app folder, the java folder, and the com.example.helloworld folder to see
the MainActivity java file. Double-clicking the file opens it in the code editor.

On the right hand side Code and Design Buttons enable us to change the code in XML and see design
Changes. Also the Design changes ultimately change the code and vice versa.

Course Coordinator: Ms. A R Kothimbire 24 Approved By:HEAD BSH


The java folder includes Java class files in three subfolders, as shown in the figure above.
The com.example.helloworld (or the domain name you have specified) folder contains all the files for an
app package. The other two folders are used for testing and described in another lesson. For the Hello
World app, there is only one package and it contains MainActivity.java. The name of the
first Activity (screen) the user sees, which also initializes app-wide resources, is customarily
called MainActivity (the file extension is omitted in the Project > Android pane).

2. Expand the res folder and the layout folder, and double-click the activity_main.xml file to open
it in the layout editor.

The res folder holds resources, such as layouts, strings, and images. An Activity is usually associated
with a layout of UI views defined as an XML file. This file is usually named after its Activity.

5. Explore the manifests folder

The manifests folder contains files that provide essential information about your app to the Android
system, which the system must have before it can run any of the app's code.

1. Expand the manifests folder.


2. Open the AndroidManifest.xml file.

The AndroidManifest.xml file describes all of the components of your Android app. All components for
an app, such as each Activity, must be declared in this XML file. In other course lessons you will modify
this file to add features and feature permissions. For an introduction, see App Manifest Overview.

Course Coordinator: Ms. A R Kothimbire 25 Approved By:HEAD BSH


6. Use a virtual device (emulator)

In this task, you will use the Device Manager to create a virtual device (also known as an emulator) that
simulates the configuration for a particular type of Android device, and use that virtual device to run the
app. Note that the Android Emulator has additional requirements beyond the basic system requirements
for Android Studio.

Using the Device Manager, you define the hardware characteristics of a device, its API level, storage,
skin and other properties and save it as a virtual device. With virtual devices, you can test apps on
different device configurations (such as tablets and phones) with different API levels, without having to
use physical devices.

7.Create an Android virtual device (AVD)

In order to run an emulator on your computer, you have to create a configuration that describes the virtual
device.In Android Studio, select Tools > Device Manager, or click the Device Manager icon in the
toolbar. The Device Manager pane appears. If you've already created virtual devices, the pane shows
them (as shown in the figure below); otherwise you see a blank list.

1. Click the Create Device button. The Select Hardware window appears showing a list of pre
configured hardware devices. For each device, the table provides a column for its diagonal
display size (Size), screen resolution in pixels (Resolution), and pixel density (Density).

Course Coordinator: Ms. A R Kothimbire 26 Approved By:HEAD BSH


2. Choose a device such as Pixel 5, and click Next. The System Image screen appears.
3. Click the Recommended tab if it is not already selected, and choose which version of the
Android system to run on the virtual device (such as R).

Course Coordinator: Ms. A R Kothimbire 27 Approved By:HEAD BSH


here are many more versions available than shown in the Recommended tab. Look at the x86
Images and Other Images tabs to see them.

If a Download link is visible next to a system image you want to use, it is not installed yet. Click the link
to start the download, and click Finish when it's done.

4. After choosing a system image, click Next. The Android Virtual Device (AVD) window
appears. You can also change the name of the AVD. Check your configuration and click Finish.

8.Run the app on the virtual device

In this task, you will finally run your Hello World app.

1. In Android Studio, choose Run > Select Device or click the devices dropdown next to
the Run icon in the toolbar and select the virtual device which you just created.
2. Choose Run > Run app or click the Run icon in the toolbar.

Course Coordinator: Ms. A R Kothimbire 28 Approved By:HEAD BSH


The emulator starts and boots just like a physical device. Depending on the speed of your computer, this
may take a while. Your app builds, and once the emulator is ready, Android Studio will upload the app to
the emulator and run it.

You should see the Hello World app as shown in the following figure.

Conclusion:-In Android Studio, navigate to the top menu and select Run 'app'. Android Studio
will show a dialog where you can choose which device to run your Android app on. Choose your
connected device and click the OK button. The Hello World application should now be running on your
phone.

Course Coordinator: Ms. A R Kothimbire 29 Approved By:HEAD BSH


ASSESSMENT QUESTIONS:

1.App module contains which of the folders? Which are the most important files inside them.

Answer:__________________________________________________________________________________
________________________________________________________________________________________
________________________________________________________________________________________
________________________________________________________________________________________
________________________________________________________________________________________

4.List the steps to create a new device in AVD?.

Answer:__________________________________________________________________________________
________________________________________________________________________________________
________________________________________________________________________________________
________________________________________________________________________________________
________________________________________________________________________________________

5. Why lower versions are selected for application development while creating project?

Answer:__________________________________________________________________________________
________________________________________________________________________________________
________________________________________________________________________________________
________________________________________________________________________________________
________________________________________________________________________________________

Course Coordinator: Ms. A R Kothimbire 30 Approved By:HEAD BSH

You might also like