0% found this document useful (0 votes)
56 views54 pages

Internship Report

The document provides details about an internship project report on web development submitted by Sapna Jayram Shelar. It includes a certificate signed by the guide and head of the department approving the report. It also includes an acknowledgement section thanking various individuals and organizations for their support. The abstract indicates that the main objectives of the internship were to learn website design and HTML, and that frameworks like MVC are commonly used to develop dynamic web applications.

Uploaded by

Sapna Shelar
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)
56 views54 pages

Internship Report

The document provides details about an internship project report on web development submitted by Sapna Jayram Shelar. It includes a certificate signed by the guide and head of the department approving the report. It also includes an acknowledgement section thanking various individuals and organizations for their support. The abstract indicates that the main objectives of the internship were to learn website design and HTML, and that frameworks like MVC are commonly used to develop dynamic web applications.

Uploaded by

Sapna Shelar
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/ 54

An Internship cum Project Report

On

Web Development
Submitted in partial fulfilment of the requirements
for the degree of
Bachelor of Technology
by
Sapna Jayram Shelar
PRN No: 2030331246012
Under the guidance of
Prof. S.R.Hivre

Department of Information Technology


Dr. Babasaheb Ambedkar Technological University,
Lonere-402103, Dist. Raigad, (MS) INDIA.
June 30, 2023
Certificate

An Internship cum project report, Web Development submitted by Sapna


Jayram Shelar (2030331246012), is approved for the partial fulfillment of
the requirements for the degree of Bachelor of Technology of Dr. Babasaheb
Ambedkar Technological University, Lenere - 402 103, Raigad (MS).

Guide Head of Department, IT


Prof. S.R.Hivre Dr. Sanjay R. Sutar

Place: Dr. Babasaheb Ambedkar Technological University, Lonere


Date: June 30, 2023

1
2
Acknowledgement

The successful joining of this internship would not have been possible
without the support and assistance of many individuals and organizations.I
feel immensely blessed to have gotten this during the course of my internship
program. I would like to take this opportunity to offer my earnest admiration
to each and every one of them.

I express my sentiment of gratitude to Mr. Omkar Malkar sir, who has been a
continuous source of inspiration as my intern trainer. without his constant
guidance and suggestions, this report would have been nowhere near
completion. My gratitude for his trust and generosity goes beyond words. I
am indebted and thankful to my learned and revered Prof. Sadhana Hivre, for
her encouraging support and providing a meticulous platform to learn.

I owe my deepest gratitude to internship coordinator Prof. Sapna Barfe


for her upbeat personality, kindness encouraging support and willingness
to help.

Thanks to my classmates who helped me directly or indirectly to accomplish


my work. Finally, I thank all my teachers, who were the people, who
prepared us for this endeavour.

3
Abstract

Website Design and learning HTML were the main objective of this
internship. To develop a webbased application there are several
programming languages that are in use. Some of them are only used for
the frontend and backend design of the software. For example, HTML3,
HTML4,HTML5,CSS,Bootstrap,Javascript etc. There are also some other
programming languages that are used to develop the dynamic functions of
the software or application. For example- PHP, Java etc. Nowadays there
are also some frameworks that use vastly. Frameworks are basically
structured programming by using Model, View and Controller. It is also
called as MVC. If we develop web based application that is very useful
for us

4
Contents

1 Introduction 1
1.1 What is Android? . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Need of Android? . . . . . . . . . . . . . . . . . . . . . . . 4

5
1.3 Features of Android . . . . . . . . . . . . . . . . . . . . . . 7
2 Steps Installation and Configure Android Studio 10
2.1 Installation Steps of JAVA JDK . . . . . . . . . . . . . . . 10
2.2 Installation Steps of Android Studio for Windows . . . . . 12
2.3 Installation Steps of Android Studio for Mac . . . . . . . . 16
2.4 Installation Steps of Android Studio for Linux . . . . . . . 16
3 Android Architecture 18
4 UI Components and Layouts 22
5 Designing User Interface With View 29
6 Conclusion 46
7 Reference 47

List of Figures
1.1 Android . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Characteristics of Android . . . . . . . . . . . . . . . . . . 6
1.3 Features of Android . . . . . . . . . . . . . . . . . . . . . . 9
2.1 Installation of JAVA JDK .................. 11
2.2 Set the Android Studio and Android SDK installation lo-
cations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.3 Create a New Shortcut for Android Studio . . . . . . . . . 14
2.4 Leave the Start Android Studio check box checked to run

6
this software . . . . . . . . . . . . . . . . . . . . . . . . . . 15

3.1 Android Architecture . . . . . . . . . . . . . . . . . . . . . 19

4.1 View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.2 View Group . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.3 Frame Layout . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.4 Linear Layout . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.5 Relative Layout . . . . . . . . . . . . . . . . . . . . . . . . 28
5.1 inheritance hierarchy of Designing user interface with view 30

5.2 TextView ........................... 32


5.3 EditText . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.4 Button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.5 ImageButton ......................... 39
5.6 ToggleButton . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.7 RadioButton ......................... 43
5.8 CheckBox . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

7
Chapter 1

Introduction

1.1 What is Android?

Android is an open source and Linux-based Operating System for mobile


devices such as smartphones and tablet computers. Android was
developed by the Open Handset Alliance, led by Google, and other
companies.
Android offers a unified approach to application development for
mobile devices which means developers need only develop for Android,
and their applications should be able to run on different devices
powered by Android.
The first beta version of the Android Software Development Kit (SDK)
was released by Google in 2007 where as the first commercial version,
Android 1.0, was released in September 2008.
On June 27, 2012, at the Google I/O conference, Google announced the
next Android version, 4.1 Jelly Bean. Jelly Bean is an incremental update,
with the primary aim of improving the user interface, both in terms of
functionality and performance.
The source code for Android is available under free and open source

1
Figure 1.1: Android

software licenses. Google publishes most of the code under the Apache
License version 2.0 and the rest, Linux kernel changes, under the GNU

2
General Public License version 2. Android is an operating system and
programming platform developed by Google for mobile phones and
other mobile devices, such as tablets. It can run on many different
devices from many different manufacturers. Android includes a software
development kit (SDK) that helps you write original code and assemble
software modules to create apps for Android users. Android also
provides a marketplace to distribute apps. All together, Android
represents an ecosystem for mobile apps.

1.2 Need of Android?

Android is a new generation mobile OS which runs on Linux Kernel there


are some following points which describes why we use Android OS:

1. Desktop: The Android phone adds widgets to the desktop the


purpose of for the Widget for example the Facebook allow us to
update our Facebook desktop the people with gets allow us to
make possible different actions for a different contacts right from
our desktop the message will get allow us to immediately see our
email from the desktop.

2. Connectivity: On one page or desktop we could be able to have


forconnecting device tool button like TURN ON Bluetooth,TURN
ON OFF WiFi,TURN ON OFF Mobile Network, TURN ON OFF GPS

3
and so on.These button let us a switch on off instantly which will
help us to conserve battery life.

3. Browser: The Android OS browser is one of the best browser


onthe mobile market. It generally loads pages faster than Safari or
any other browser has flash support and simply does everything a
browser should do. for Example iphone has a safari browser.It is
stable has no flash support so we cannot watched YouTube videos
or any related wanted it is not flexible but monopolistic.

4. Open to Carrier: If we know the programming language then we


areopen to Android world.

5. Market: Android OS has an Android market the Android apps


arefree and work as well.

6. future: Future mobile phones are basically going to be smart


phones.

7. Muti-Notification: Android phones have a multi notification


systemwith Android app have access to the notification system
and call all report.

8. Google Integration: Android has inbuilt Google support. For


exampleGoogle Map, gmail, etc.

9. Open Source: The code of android os as well as the app is available.

4
10. Endless Personalization: The Android cell phone allows to
configuration mobile to look and behave exactly like they want.

Figure 1.2: Characteristics of Android

1.3 Features of Android

There are numerous features of android. Some of them are listed below:

5
1. Connectivity: Android supports multiple connectivity
technologiesincluding GSM/EDGE, IDEN, CDMA, EV-DO, UMTS,
Bluetooth, Wi-Fi, LTE, NFC, and WiMAX.

2. Storage: SQLite, a lightweight relational database, is used for


datastorage purposes.

3. Media support: Android supports various types of


audio/video/stillmedia formats like H.263, H.264, MPEG-4 SP,
AMR, AMR-WB, AAC, HE-AAC, AAC 5.1, MP3, MIDI, Ogg Vorbis,
WAV, JPEG, PNG, GIF, BMP and WebP.

4. Web browser: The web browser available in Android is based on


theopen-source Blink (previously WebKit) layout engine, coupled
with Chrome’s V8 JavaScript engine : Widgets are resizable, so
users can expand them to show more content or shrink them to
save space supporting HTML5 and CSS3.

5. Messaging: SMS and MMS are available forms of messaging, it


alsoincludes threaded text messaging and Android Cloud To
Device Messaging (C2DM) and now supports the enhanced version
of C2DM, Android Google Cloud Messaging (GCM) is also a part of
Android Push Messaging services.

6. Multi-tasking: Multitasking of applications, with unique handling


ofmemory allocation, is available, using this users can jump from

6
one task to another and at the same time various applications can
run simultaneously.

7. Resizable widgets: Widgets are resizable, so users can expand


themto show more content or shrink them to save space.

8. Multi-touch: Android has native support for multi-touch which


wasinitially made available in handsets such as the HTC Hero.

9. Wi-Fi: A technology that lets apps discover and pair directly, over
ahigh-bandwidth peer-to-peer connection.

10. Screen capture: Android supports capturing a screenshot by


pressingthe power and home-screen buttons at the same time.
This feature supports after Android 4.0.

11. Multi-Language: Android supports multiple languages, also


supportsthe single direction and bi-directional text.

7
Figure 1.3: Features of Android

Chapter 2

Steps Installation and Configure Android


Studio

2.1 Installation Steps of JAVA JDK

It is mandatory to download the Java JDK. There are only seven steps for
the installation process of Java JDK which are as follows:

1. Firstly, click on the following link to download JDK.

8
https://www.oracle.com/technetwork/java/javase/downloads/index.html

2. By clicking on the link given above you will be directed to the


ORACLE page, there will be some links as depicted in the above
picture. 3. After that, click on Accept Agreement License.

4. Then, download the link as per your operating system that is


Windows, Mac, Linux.

Figure 2.1: Installation of JAVA JDK

5. After downloading the file, click on the downloaded file and


installJDK.

6. Now, after installation, we need to set the environment variable.

9
7. Lastly, to set environment variable, follow this, Control Panel-
¿Systemand Security-¿ System-¿ Advanced setting-¿Environment
variable -¿ Add new path.
By following these steps you will successfully add the environment
variable. Now, we will see the installation process of Android studio
for Windows, Mac and Linux.

2.2 Installation Steps of Android Studio for Windows

There are just three steps for installing Android studio for windows
which are as follows:

1. Firstly, to download Android Studio This will direct you to the


officialwebsite of Android Studio.

2. Then, click on download Android Studio as shown.

3. Lastly, click on the downloaded file and packages will install,


automatically. We are done with installation for windows and now
you can start making your application using Android Studio.
OR
Clicking Next took me to the following dialog box, which gives you
the option to decline installing the Android SDK (included with the
installer) and an Android Virtual Device (AVD).

10
I chose to keep the default settings. After clicking Next, you’ll be
taken to the license agreement dialog box. Accept the license to
continue the installation.
The next dialog box invites you to change the installation locations
for Android Studio and the Android SDK.
Change the location or accept the default locations and click Next.
The installer defaults to creating a shortcut for launching this
program, or you can choose to decline. I recommend that you create
the

Figure 2.2: Set the Android Studio and Android SDK installation locations

11
Figure 2.3: Create a New Shortcut for Android Studio

12
Figure 2.4: Leave the Start Android Studio check box checked to run this software

shortcut, then click the Install button to begin installation.


The resulting dialog box shows the progress of installing Android
Studio and the Android SDK. Clicking the Show Details button will
let you view detailed information about the installation progress.
The dialog box will inform you when installation has finished.
To complete your installation, leave the Start Android Studio box
checked and click Finish.

13
2.3 Installation Steps of Android Studio for Mac

Following are the steps for installing Android studio for Mac:

1. Go on official page of Android Studio where you will get an option


todownload Android Studio.

2. After that, click on the button and dmg file will download.

3. Open the dmg file by double-clicking on it.

4. Then, drag and drop the Android Studio icon in the


applicationfolder. This will copy all the files of Android Studio in the
applications folder and you will be able to see the Android Studio
icon in the application.

2.4 Installation Steps of Android Studio for Linux

Just follow these three steps to download Android Studio for Linux:
1. Download Android Studio file.

2. Now,unzip and extract the downloaded file.

3. Now to run Android Studio, open terminal and then open bin
directory and execute the studio.sh command on the terminal.

4. And then you can build your Android applications on your


Linuxsystem as well.

14
.

15
Chapter 3

Android Architecture

Android operating system is a stack of software components which is


roughly divided into five sections and four main layers as shown below
in the architecture diagram. Linux kernel:- At the bottom of the layers is
Linux - Linux 3.6 with approximately 115 patches. This provides a level
of abstraction between the device hardware and it contains all the
essential hardware drivers like camera, keypad, display etc. Also, the
kernel handles all the things that Linux is really good at such as
networking and a vast array of device drivers, which take the pain out of
interfacing to peripheral hardware.
Libraries:- On top of Linux kernel there is a set of libraries including
open-source Web browser engine WebKit, well known library libc,
SQLite database which is a useful repository for storage and sharing of
application data, libraries to play and record audio and video, SSL
libraries responsible for Internet security etc.
Android Libraries:- This category encompasses those Java-based
libraries that are specific to Android development. Examples of libraries

16
Figure 3.1: Android Architecture

in this category include the application framework libraries in addition


to those that facilitate user interface building, graphics drawing and
database access. A summary of some key core Android libraries
available to the Android developer is as follows android.app Provides
access to the application model and is the cor-
nerstone of all Android applications.

1. android.content Facilitates content access, publishing and


messagingbetween applications and application components.

2. android.database Used to access data published by content


providersand includes SQLite database management classes.

17
3. android.opengl A Java interface to the OpenGL ES 3D graphics
rendering API.

4. android.os Provides applications with access to standard


operatingsystem services including messages, system services and
inter-process communication.

5. android.text Used to render and manipulate text on a device display.

6. android.view The fundamental building blocks of application


user interfaces.

7. android.widget A rich collection of pre-built user interface


components such as buttons, labels, list views, layout managers,
radio buttons etc.

8. android.webkit A set of classes intended to allow web-browsing


capabilities to be built into applications.
Having covered the Java-based core libraries in the Android
runtime, it is now time to turn our attention to the C/C++ based
libraries contained in this layer of the Android software stack.

Android Runtime:- This is the third section of the architecture and


available on the second layer from the bottom. This section provides a
key component called Dalvik Virtual Machine which is a kind of Java
Virtual Machine specially designed and optimized for Android. The
Dalvik VM makes use of Linux core features like memory management

18
and multithreading, which is intrinsic in the Java language. The Dalvik
VM enables every Android application to run in its own process, with its
own instance of the Dalvik virtual machine. The Android runtime also
provides a set of core libraries which enable Android application
developers to write Android applications using standard Java
programming language.
Application Framework:- The Application Framework layer provides
many higher-level services to applications in the form of Java classes.
Application developers are allowed to make use of these services in their
applications.
The Android framework includes the following key services

1. Activity Manager Controls all aspects of the application lifecycle


andactivity stack.

2. Content Providers Allows applications to publish and share data


with other applications.

3. Resource Manager Provides access to non-code embedded


resourcessuch as strings, color settings and user interface layouts.

4. Notifications Manager Allows applications to display alerts and


notifications to the user.

5. View System An extensible set of views used to create


applicationuser interfaces.

19
Applications:- You will find all the Android application at the top
layer. You will write your application to be installed on this layer only.
Examples of such applications are Contacts Books, Browser, Games etc.

Chapter 4

UI Components and Layouts

Android Layout is used to define the user interface that holds the UI
controls or widgets that will appear on the screen of an android
application or activity screen. Generally, every application is a
combination of View and ViewGroup. As we know, an android
application contains a large number of activities and we can say each
activity is one page of the application. So, each activity contains multiple
user interface components and those components are the instances of
the View and ViewGroup. All the elements in a layout are built using a
hierarchy of View and ViewGroup objects. View:- A View is defined as
the user interface which is used to create interactive UI components
such as TextView, ImageView, EditText, RadioButton, etc., and is
responsible for event handling and drawing. They are Generally Called
Widgets.

20
A ViewGroup act as a base class for layouts and layouts parameters
that hold other Views or ViewGroups and to define the layout properties.
They are Generally Called layouts.
The Android framework will allow us to use UI elements or widgets in

Figure 4.1: View

21
Figure 4.2: View Group

two ways:
1. Use UI elements in the XML file

2. Create elements in the Kotlin file dynamically


Types of Android Layout:-
1. Android Linear Layout: LinearLayout is a ViewGroup subclass,
usedto provide child View elements one by one either in a
particular direction either horizontally or vertically based on the
orientation property.

2. Android Relative Layout: RelativeLayout is a ViewGroup


subclass,used to specify the position of child View elements relative

22
to each other like (A to the right of B) or relative to the parent (fix to
the top of the parent).

3. Android Constraint Layout: ConstraintLayout is a ViewGroup


subclass, used to specify the position of layout constraints for every
child View relative to other views present. A ConstraintLayout is
similar to a RelativeLayout, but having more power.

4. Android Frame Layout: FrameLayout is a ViewGroup subclass,


usedto specify the position of View elements it contains on the top
of each other to display only a single View inside the FrameLayout.

5. Android Table Layout: TableLayout is a ViewGroup subclass, usedto


display the child View elements in rows and columns.

6. Android Web View: WebView is a browser that is used to display


theweb pages in our activity layout.

7. Android ListView: ListView is a ViewGroup, used to display


scrollable lists of items in a single column.

8. Android Grid View: GridView is a ViewGroup that is used to


displaya scrollable list of items in a grid view of rows and columns.

Layout Managers (or simply layouts) are said to be extensions of the


ViewGroup class. They are used to set the position of child Views within
the UI we are building. We can nest the layouts, and therefore we can
create arbitrarily complex UIs using a c GridLayout- It was introduced in

23
Android 4.0 (API level 14), the Grid Layout used a rectangular grid of
infinitely thin lines to lay out Views in a series of rows and columns. The
Grid Layout is incredibly flexible and can be used to greatly simplify
layouts and reduce or eliminate the complex nesting often required to
construct UIs using the layouts described before.ombination of layouts.
There is a number of layout classes in the Android SDK. They can be
used, modified or can create your own to make the UI for your Views,
Fragments and Activities. You can display your contents effectively by
using the right combination of layouts.
The most commonly used layout classes that are found in Android
SDK are:

1. FrameLayout- It is the simplest of the Layout Managers that


pinseach child view within its frame. By default the position is the
top-left corner, though the gravity attribute can be used to alter its
locations. You can add multiple children stacks each new child on
top of the one before, with each new View potentially obscuring the
previous ones.

2. LinearLayout- A LinearLayout aligns each of the child View in


eithera vertical or a horizontal line. A vertical layout has a column of
Views, whereas in a horizontal layout there is a row of Views. It
supports a weight attribute for each child View that can control the
relative size of each child View within the available space.

24
3. RelativeLayout- It is flexible than other native layouts as it lets us
todefine the position of each child View relative to the other views
and the dimensions of the screen.

Figure 4.3: Frame Layout

25
Figure 4.4: Linear Layout

Figure 4.5: Relative Layout

26
Chapter 5

Designing User Interface With View

view class represent the basic building block for user interface
components. A view occupies a rectangular Area on the screen and is
responsible for drawing and event handling. View is the base class for
widgets, which are used to create interactive UI components like
buttons, text fields, etc. The ViewGroup is a subclass of View and
provides invisible container that hold other Views or other ViewGroups
and define their layout properties. A veiw group is a special view that
can contain other views. The view group is the best class for layouts and
view containers. The view is the component with Android providers to
design the layouts of the app. A view is a superclass for all the UI
components. The View class serves as the base for subclasses called
”widgets,” which offer fully implemented UI objects, like text fields and
buttons. The ViewGroup class serves as the base for subclasses called
”layouts,” which offer different kinds of layout architecture, like linear,
tabular and relative. A View object is a data structure whose properties
store the layout parameters and content for a specific rectangular area
of the screen. A View object handles its own

27
Figure 5.1: inheritance hierarchy of Designing user interface with view
measurement, layout, drawing, focus change, scrolling, and key/gesture
interactions for the rectangular area of the screen in which it resides. As
an object in the user interface, a View is also a point of interaction for the
user and the receiver of the interaction events. In this chapter deals with
how to design a page by using graphical user interface(GUI), as it is very
important to design a good looking page for apps in Android here we
will discuss GUI like TextView(Lable),Button, EditText(TextField),
CheckBox,etc.

• TextView: A TextView displays text to the user and optionally


allows them to edit it. A TextView is a complete text editor, however
the basic class is configured to not allow editing. In android,
TextView is a user interface control that is used to set and display
the text to the user based on our requirements. The TextView

28
control will act as like label control and it won’t allow users to edit
the text.

Attributes/Properties of TextView:

• id: Id is an attribute used to uniquely identify a text view. Below is


the example code in which we set the id of a text view.

• gravity: The gravity attribute is an optional attribute which is used


to control the alignment of the text like left, right, center, top,
bottom, centervertical, centerhorizontal etc.

• text: text attribute is used to set the text in a text view. We can set
the text in xml as well as in the java class. Below is the example code
with explanation included in which we set the text AbhiAndroid in a
text view.

• textColor: textColor attribute is used to set the text color of a text


view. Color value is in the form of “argb”, “rgb”, “rrggbb”, or
“aarrggbb”.

• textSize: textSize attribute is used to set the size of text of a text


view. We can set the text size in sp(scale independent pixel) or
dp(density pixel).

29
• background: background attribute is used to set the background of
a text view. We can set a color or a drawable in the background of a
text view.

• padding: padding attribute is used to set the padding from left,


right, top or bottom. In above example code of background we also
set the 10dp padding from all the side’s of text view.

30
Figure 5.2: TextView

• EditText: A EditText is an overlay over TextView that configures


itself to be editable. It is the predefined subclass of TextView that
includes rich editing capabilities. Edittext refers to the widget that

31
displays an empty textfield in which a user can enter the required
text and this text is further used inside our application.

Attributes/Properties of EditText:

• id: Used to uniquely identify the control

• gravity: Used to specify how to align the text like left, right, center,
top, etc.

• hint: Used to display the hint text when text is empty.

• text: Used to set the text of the EditText.

• textSize: Used to set size of the text.

• textColor: Used to set color of the text. TextColor attribute of


TextView widget lets you set a color of your choice. You can provide
the color as hex value in one of the four formats: rgb, argb, rrggbb,
or aarrggbb.

• textStyle: Used to set style of the text. For example, bold, italic,
bolditalic, etc. Text styles define three sizes for the formatted text
’full’, ’short’ and ’narrow’

• textAllCaps:Used this attribute to show the text in capital letters.

• width: It makes the TextView be exactly this many pixels wide.

32
• height: It makes the TextView be exactly this many pixels tall.

• maxWidth: Used to make the TextView be at most this many pixels


wide.

• minWidth: Used to make the TextView be at least this many pixels


wide.

• background: Used to set background to this View.

• clickable: Used to set true when you want to make this View
clickable.
Otherwise, set false.

• drawableBottom: Used to set drawable to bottom of the text in this


view.

• drawableEnd: Used to set drawable to end of the text in this view.

• drawableLeft: Used to set drawable to left of the text in this view.

• drawablePadding: Used to set drawable to right of the text in this


view.

• drawableStart: Used to set drawable to start of the text in this view.

• drawableTop: Used to set drawable to top of the text in this view.

• elevation: Used to set elevation to this view.

33
• padding: The padding attribute is used to set the padding from left,
right,top or bottom. In above example code of background we also
set the 10dp padding from all the slides of bottom.

Figure 5.3: EditText

34
• Button: A button consists of text or an icon (or both text and an
icon) that communicates what action occurs when the user touches
it. Android Button represents a push-button. The
android.widget.Button is subclass of TextView class and
CompoundButton is the subclass of Button class. There are different
types of buttons in android such as RadioButton, ToggleButton,
CompoundButton etc.

Attributes/Properties of Button:

• id: Used to specify the id of the view.

• textColor: Used to the display color of the text.

• textSize: Used to the display size of the text.

• textStyle: Used to the display style of the text like Bold, Italic, etc.

• textAllCaps: Used to display text in Capital letters.

• background: Used to set the background of the view.

• padding: Used to set the padding of the view. the padding attribute
is used to set the padding from left, right, top or bottom. In above
example code of background we also set the 10dp padding from all
the slides of bottom.

• visibility: Used to set the visibility of the view.

35
• gravity: Used to specify the gravity of the view like center, top,
bottom, etc

Figure 5.4: Button

• ImageButton: In Android, ImageButton is used to display a normal


button with a custom image in a button. In simple words we can
say, ImageButton is a button with an image that can be pressed or
clicked by the users. By default it looks like a normal button with
the standard button background that changes the color during
different button states. An image on the surface of a button is
defined within a xml (i.e. layout ) by using src attribute or within
java class by using setImageResource() method. We can also set an
image or custom drawable in the background of the image button.

36
Attributes/Properties of ImageButton:

• id: Id is an attribute used to uniquely identify a image button.

• src: src is an attribute used to set a source file of image or you can
say image in your image button to make your layout look attractive.

• background: background attribute is used to set the background of


an image button. We can set a color or a drawable in the
background of a Button.

• padding: padding attribute is used to set the padding from left,


right, top or bottom of the ImageButton.

– paddingRight : set the padding from the right side of the image
button.

– paddingLeft : set the padding from the left side of the image
button.

– paddingTop : set the padding from the top side of the image
button.

– paddingBottom : set the padding from the bottom side of the


image button.

– padding : set the padding from the all side’s of the image button.

• Step 1: Create a new project and name it ImageButtonExample.

37
• Step 2: Right click on drawable- New- Drawable resource file and
create new xml file name customimage-buttton.xml.

• Step 3: Open app-layout- activity main.xml (or) main.xml.

• Step 4: Open app-package- MainActivity.java.

Figure 5.5: ImageButton

38
• ToggleButton: A toggle button allows the user to change a setting
between two states. You can add a basic toggle button to your
layout with the ToggleButton object. Android 4.0 (API level 14)
introduces another kind of toggle button called a switch that
provides a slider control, which you can add with a Switch object.

Attributes/Properties of ToggleButton:

• id: This supplies an identifier name for this view.

• disabledAlpha: This is the alpha to apply to the indicator when


disabled.

• textOff: This is the text for the button when it is not checked.

• textOn: This is the text for the button when it is checked.

• autoText: If set, specifies that this TextView has a textual input


method and automatically corrects some common spelling errors.

• drawableBottom: This is the drawable to be drawn below the text.

• drawableRight: This is the drawable to be drawn to the right of the


text.

• editable: If set, specifies that this TextView has an input method.

• text: This is the Text to display.

39
• background: This is a drawable to use as the background.

Figure 5.6: ToggleButton

• RadioButton: Radio buttons allow the user to select one option from
a set. You should use radio buttons for optional sets that are
mutually exclusive if you think that the user needs to see all
available options side-by-side. If it’s not necessary to show all
options side-byside, use a spinner instead.To create each radio
button option, create a RadioButton in your layout. However,
because radio buttons are mutually exclusive, you must group them
together inside a RadioGroup. By grouping them together, the
system ensures that only one radio button can be selected at a time.
Beginning with Android RadioButton, A RadioButton is a button
that has two states, that are either check or uncheck. This means if

40
we click on a RadioButton it gets into Checked state and by default,
it comes in Unchecked State.

In the Android Radio button, one thing to be noted is, once it gets
into the checked state we cannot undo it. Generally, we use them in
our application to let the users select one option from a set of
options. Radio Button is one of the important Android UI controls,
as it provides an interactive User Interface for the users.

Attributes/Properties of RadioButton:

• id: It set a unique identity.

• checked: It specifies the current state of the button.

• gravity: It sets the alignment of the text.

• text: It sets the text for the Radio Button.

• textColor: It sets the color of the text.

• textSize: It sets the size of the text.

• textStyle: It sets the style of the text, like – bold, italics. Text styles
define three sizes for the formatted text - ’full’, ’short’ and ’narrow’

• background: It sets the color for the background of the button.

41
• padding: It sets the padding from left, right bottom or the top. In
above example code of background we also set the 10dp padding
from all the slides of bottom.

• onClick: It invokes the method onClick() when the button is clicked.

• visibility: It controls the visibility of the Radio Button.

42
Figure 5.7: RadioButton

• CheckBox: CheckBox is also a two-state button, it can have either


checked state or unchecked state. The major difference between
Android CheckBox and Android RadioButton is that checkboxes can
be unchecked manually. Android CheckBox is mostly useful when
there are multiple options the users are allowed to choose all the
options that are applicable.

Attributes/Properties of RadioButton:

• id: It set a unique identity

• checked: It specifies the current state of the CheckBox.

• gravity: It sets the alignment of the CheckBox.

• text: It sets the text for the Radio CheckBox.

• textColor: It sets the color of the text in the CheckBox.

• textSize: It sets the size of the text in CheckBox.

• textStyle: It sets the style of the text, like – bold, italics.

• background: It sets the color for the background of the CheckBox.

• padding: It sets the padding from left, right bottom or the top.

43
• onClick: It invokes the method onClick() when the button is clicked.

• visibility: It controls the visibility of the CheckBox.

Figure 5.8: CheckBox

Chapter 6

44
Conclusion

I’ve learned through my research that Android is a much more diverse


operating system than iOS and Windows Phone Mobile. Android has
grown rapidly over the past 4 years becoming the most used
smartphone operating system in the world. It’s because Android doesn’t
release 1 phone from 1 company with 1 new OS every year, but
countless phones from numerous companies, adding their own twist,
throughout the year, developing gradually day-by-day. Android’s ability
to customize is unparalleled compared to Apple’s and Microsoft’s
software allowing the user to change and customize nearly every aspect
of Android which most iPhone and Windows 7 users wouldn’t dream
possible. I am not one to say that Android is better or worse than one OS,
but is unique and incomparable to other mobile operating systems.

Chapter 7

Reference

1. Thomas C. G. A. Jayanthila
Devihttps://www.emerald.com/insight/content/doi/10.1108/AAO
UJ-02-20180013/full/html

45
2. Instituto Politecnico de Leiria, Leiria, Leiria,
PThttps://ieeexplore.ieee.org/document/7975825/authorsauthors

3. Jones, M., Marsden, G., Ebooks Corporation. (2006).Mobile


Interaction Design (1st ed.). John Wiley Sons, Ltd.
https://ebookcentral.proquest.com/lib/qut/detail.action?docID=255361

4. Neil, T., Ebooks Corporation. (2012). Mobile design pattern gallery:


UI patterns for mobile applications. O’Reilly Media.
https://ebookcentral.proquest.com/lib/qut/detail.action?docID=871556

46

You might also like