Final Training Report by Arvind 2

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

A

TRAINING REPORT

ON

“Android App Development”

Submitted In Fulfillment of the Requirement for the Award of Degree


Of

BACHELOR OF TECHNOLOGY
In

Electrical Engineering

RAJASTHAN TECHNICAL UNIVERSITY, KOTA


SUBMITTED TO:- SUBMITTED BY:-

Mr. Prashant Tyagi Arvind Kumar

Assistant Professor (17EMCEE011)

Department Of EE 7th SEM

Department of Electrical Engineering

MODERN INSTITUTE OF TECHNOLOGY & RESEARCH CENTRE, ALWAR

i
Modern Institute of Technology and Research Centre,
Alwar

CERTIFICATE

ii
ACKNOWLEDGEMENT

The project work in this report is an outcome of continuous work over a period and drew
intellectual support from various sources. I would like to articulate our profound gratitude
and indebtedness to those persons who helped us in completion of the project.

I take this opportunity to express my sincere thanks and deep gratitude to all those people
who extended their wholehearted co-operation and have helped me in completing this
project successfully. I am thankful to InternShala Training Associates for teaching and
assisting me in making the project successful.

We sincerely acknowledge to Mr. Manish Gupta for technical insights, support for
literature and all the moral support provided to us at all stages of this endeavor, without
which it would not have been possible to prepare this training.

I would also like to thank our parents & other fellow mates for guiding and encouraging
me throughout the duration of the project. I am also very thankful to Dr. S.K SHARMA,
Director (MITRC, Alwar) and Mr. PARSHANT TYAGI Head of Department of
Electrical Engineering (MITRC, Alwar) for providing us moral support to go ahead with
our training.

Deepak

4th Year, 7th Sem


Electrical Engineering

iii
Table of Content
Certificate…………………………………………………………………………..i

Acknowledgement……………………………………………………………..…..ii

Abstract………………………………………………………………………….....iii

Chapter Name

1 XML Page No
1.1 Tags…………………………………………………………………………….3
1.2 User Interface…………………………………………………………………..4
1.3 Layout………………………………………………………………………….4
1.4 View & View Group…………………………………………………………...5
1.5 Margin & Padding……………………………………………………………...5
1.6 Buttons & Hints……………………………………………………………..…6
1.7 Colour Code……………………………………………………………………7
1.8 Project…………………………………………………………………………8

2 Kotlin

2.1.1 Features of Kotlin………………………………………………………….9


2.1.2 JVM………………………………………………………………………..9
2.1.3 Cross Platform……………………………………………………………..9
2.1.4 Statically typed Language………………………………………………….9
2.1.5 Inference……………………………………………………………………10

2.2 Variables……………………………………………………………………….10
2.2.1 Var Variable………………………………………………………………..10
2.2.2 Val Variable………………………………………………………………..10

2.3 Operators……………………………………………………………………….10
2.3.1 Functions of Operators……………………………………………………..10

2.4 Functions………………………………………………………………………..11
2.5 Argument………………………………………………………………………..11
2.6 Array…………………………………………………………………………….11
2.7 List………………………………………………………………………………11
2.8 Intent…………………………………………………………………………….12
2.9 Hamburger Icon…………………………………………………………………13

iv
2.10 Fragments…………………………………………………………………...13
2.11 App Bar Layout………………………………………………………………14
2.12 Layout Manager………………………………………………………………15
2.12.1 Linear Layout Manager……………………………………………………….15
2.12.2 Grid Layout Manager…………………………………………………………15

2.13 Adapter………………………………………………………………………..16
2.14 HTTP………………………………………………………………………….16
2.15 Activity………………………………………………………………………..16
2.16 setOnClickListner……………………………………………………………..16
2.17 Classes & Inheritance………………………………………………………….17
2.17.1 Constructor…………………………………………………………………….17
2.17.2 Secondary Constructor………………………………………………………...17
2.17.3 Inheritances……………………………………………………………………17
2.17.4 Visibility Modifier…………………………………………………………….18
2.18 Error & Exception……………………………………………………………..18
2.19 Database……………………………………………………………………….18
2.20 Relational Database…………………………………………………………...19

v
List of Figure

Name of Figure Page No

1 XML

1.1 Basic of XML........................................................................................................3


1.2 Basic of XML........................................................................................................4
1.3 User Interface........................................................................................................4
1.4 View Group...........................................................................................................5
1.5 Margin & Padding.................................................................................................6
1.6 Buttons..................................................................................................................7
1.7 Colour Code..........................................................................................................7
1.8 Project....................................................................................................................8
1.9 Project....................................................................................................................8

2 Kotlin

2.1 Operators...............................................................................................................10
2.2 Operator’s functions..............................................................................................11
2.3 Intent......................................................................................................................12
2.4 Project....................................................................................................................12
2.5 Project....................................................................................................................12
2.6 Hamburger Icon.....................................................................................................13
2.7 Fragment Transaction............................................................................................14
2.8 App Bar Layout.....................................................................................................14
2.9 Linear Layout Manager.........................................................................................15
2.10 Grid Layout Manager................................................................................15
2.11 Callback Activity.......................................................................................16
2.12 Visibility Modifier.....................................................................................18
2.13 Room Database..........................................................................................19
2.14 Relational Database...................................................................................19

vi
INTRODUCTION

The present report has been prepared on the Android App Development.

This report provides information about designing of android App and designing of its User
Interface.

In this training we use Android Studio for designing our App in two languages are used one
of which was Kotlin language for whole background process and working and other one
was XML as designing of User Interface.

This training is divided into two parts, first one is designing of User Interface in which we
design user Interface and other one is on working of our app.

Language (Kotlin) development costs are born by JetBrains, while the Kotlin foundation
protects the trademark. Kotlin is a statically typed programming language based on Java
virtual machine.

On 7 May 2019, Google announced that the Kotlin is now its preferred language for Android
app developers

Android studio was announced on May 16, 2013 at the Google I/O conference. Android
Studio is the official integrated development environment (IDE) for Google Android
operating system.

Android Studio is an environment that helps us to create android apps. It has InteliJ’s
powerful code editor and developer tools, and various other features that enhance.

1
ABSTRACT

Kotlin is a cross-platform, statically typed, general-purpose programming language with type


inference. Kotlin is designed to interoperate fully with Java, and the JVM version of Kotlin's
standard library depends on the Java Class Library, but type inference allows its syntax to be
more concise.

Kotlin is officially supported by Google for Android development, meaning that Android
documentation and tooling is designed with Kotlin in mind. Certain Android APIs, like
Android KTX, are Kotlin-specific, but most are written in Java and can be called from
either Java or Kotlin.

Kotlin can be used for any kind of development, be it server-side, client-side web and
Android. With Kotlin/Native currently in the works, support for other platforms such as
embedded systems, macOS and iOS is coming.

Extensible Markup Language (XML) is a markup language that defines a set of rules for
encoding documents in a format that is both human-readable and machine-readable. The
World Wide Web Consortium's XML 1.0 Specification of 1998 and several other related
specifications—all of them free open standards—define XML.

Android Studio is the official integrated development environment for Google’s Android
operating system, built on JetBrains’ IntelliJ IDEA software and designed specifically for
Android Studio.

Android Studio supports all the same programming languages of IntelliJ (and CLion)
e.g. Java, C++, and more with extensions, such as Go; and Android Studio 3.0 or later
supports Kotlin and "all Java 7 language features and a subset of Java 8 language features
that vary by platform version."

2
CHEPTER 1
(XML)
An XML file is an extensible markup language file, and it is used to structure data for storage
and transport. In an XML file, there are both tags and text. The tags provide the structure to
the data. Extensible Markup Language (XML) is a markup language that defines a set of rules
for encoding documents in a format that is both human-readable and machine-readable. The
World Wide Web Consortium's XML 1.0 Specification of 1998 and several other related
specifications—all of them free open standards—define XML.

By the help of XML language we can create a User Interface according to developers.

The coding practice in XML is simple and not too much complicated as Kotlin. As for the
example following is basic of XML -:

Fig. 1.1
In XML we use tags in coding practice. There are opening and closing tags which are used
for different-different purposes.

1.1 Tags:
There are many tags are used in XML (opening and closing tags).

They are used when program is start to write (beginning) and other one when program ends.

In below images there is basic (opening and closing) of Tags which are as follows-:

3
Fig 1.2

1.2 User Interface:


Now we know that XML is used to create User Interface of any apps which we create during
training. So now question comes what is User Interface. In following image there is definition
of User Interface-:

Fig 1.3

1.3 Layout:
A layout defines the structure in which the various elements on the screen or the activity will
be arranged. In this training we studied about tow layouts i.e. Linear layout and other one is
Relative Layout. Linear layouts are used when we want to arrange the widgets in a linear
manner on the screen.

4
Relative layouts are used when we want to arrange the widgets in a relation to one other, or
in relation to the screen.

1.4 View & ViewGroup:


A View object is something that is drawn and that the user interacts with. It is a concrete
element on the screen that is visible to user.

ViewGroup object are invisible objects that contain other View and ViewGroup objects i.e.-
:

Fig 1.4

1.5 Margin & Padding:


In User Interface three are Margin and Padding which are important factors for any app’s
User Interface.

Margin is used to shift any view from the boundary or the parent layout. This feature can
decide our app’s look.

Padding creates space between the view inside the container and the container boundary. For
ex it decides the space between two lines, Images, paragraphs, etc.

In simple word, Margin means to push outside, whereas Padding means to push inside.

The margin clears an area around an element (outside the border), but the padding clears an
area around the content (inside the border) of an element. It means that our element does not
know about its outside margins.

In following image we can clearly see the Margin & padding-:

5
Fig 1.5

1.6 Buttons and Edit Text or Hints:


As we know that the main screen of our apps or User interface of app contains many things,
for ex. – Images, Hints, Buttons, Edit Text, etc.

A button consists of text or an icon (or both text and an icon) that communicates what action
occurs when the user touches it.

Buttons are very important widget on the screen. Buttons are usually used as jump to one
screen to another screen this is called Intent. By the coding practice we can enable button as
clickable this is part of further training. Edit Text & Hints are able to take inputs from the
user which is very help full and user friendly. Edit Text & Hints both are takes input but main
difference is that Edit Text have the visible input i.e. whenever we type in Edit Text the data
will be clear. In Hints the input is partly visible i.e. data will not be clear. In following image
the buttons and edit text are shown. Edit text can be replace with hints.

Every button is styled using the system's default button background, which is often different
from one version of the platform to another. If you are not satisfied with the default button
style, you can customize it. When the user touches or clicks a button, the button performs an
action. The button's text or icon should provide a hint about what that action will be.
(Buttons are sometimes called "push-buttons" in Android documentation.)

6
Fig 1.6

1.7 Color Code:


There are many colors are available in XML, each color having a unique id. This feature
helps in to choose favorite colors of our apps.

Some ex. Of color code are given below-:

Fig 1.7

7
1.8 Project on XML Submitted:
There are some projects or prototype of any random apps which are submitted by us during
the training-:

Fig 1.8 Fig 1.9

8
CHPTER 2
(KOTLIN)
2.1 Features of Kotlin:
Target the JVM, Kotlin is a cross-platform, statically typed, general-purpose programming
language with type interface. Kotlin is designed to interoperate fully with Java but type
inference allows its syntax to be more concise. Kotlin sponsored by JetBrains and Google
through the Kotlin foundation.

2.1.1 JVM-:
A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java
programs as well as programs written in other languages (Kotlin as of here) that are also
compiled to java byte code.

JVM is the machine that takes the Java byte code given by the Java compiler & executes this
code.

Code written in Kotlin

Compiled to Java byte code


by the Java Compiler

JVM run this byte code and


gives the output

2.1.2 Cross-Platform:
Kotlin is cross platform language i.e. the code written in window can be execute in ‘mac-os’
& in ‘Linux’ & vice-versa.

2.1.3 Statically-typed language:


Statically typed programming languages do type checking (i.e. they verify and enforce the
constrain of types) at compile time.
This means that the language is able to tell the data type of any variable during the compile
time and does not allows a variable to have values of different data types in a single program.

9
2.1.4 Inference:
This means that the language can automatically detect the data type.

2.2 Variables:
Variables are like names that are used to store the data. We use variables because it is helpful
to work with the unknown data when we use variables and it makes our program efficient.
There are two types of variable-:

2.2.1 Var Variable:


The Var type variables are mutable, that is the data stored in them can change i.e. if we
assign a data in Var variable than it can change by us in further program.

2.2.2 Val Variable:


The Val type variables are immutable i.e. the data stored in them cannot be change.

2.3 Operators:
Operators are symbol which are used to perform some operating or set of operations on a
variable or a set of variables.
Followings are the operators-:

Fig 2.1
2.3 .1 Function of Operators:
There are many operators as we saw above. Each operator has their own function. For ex if
we use ‘+’ between two variables than its meaning is addition of two variables. The
following table describing the function and naming of each operator-:

10
Fig 2.2

2.4 Functions:
Functions are a collection of codes that returns some result. Function can combine a group of
activities, represented by a single name called the Function Name. They are the most basic
ways to organize programs.

2.5 Arguments:
Arguments are the data or information that the fun needs to use to perform the operation. For
ex, If a function calculates the sum of ‘a’ and ‘b’
fun ‘function name’ (a:int, b:int).

2.6 Array:
An array is a data structure that contains a group of element, mostly of the same data type,
such as an integer or string.
Arrays are commonly used in computer programs to organize data so that a related set of
values can be easily stored or searched.
In Kotlin when an array is declared than we can only change the content of array not its size.

2.7 List:
A list can store many items of the same or different data types. They are just like arrays. They
are two types-:
2.7.1 Mutable List.
2.7.2 Immutable List.

11
2.8 Intent:

Intent works as a bridge between two screens. For ex whenever we click on login button on
face book page it will bring us on a new screen i.e. our home screen of our id.
So in official what is Intent?

Fig 2.3
The following ex shows the working of Intent-:

Fig 2.4 Fig 2.5

12
2.9 Hamburger Icon:
The Hamburger icon is known as the action bar drawer. It is used to open and close the
navigation drawer. For adding it on homescreen we should, enable the home button by using
setHomeAsUpEnabled( ) method. Make a toggle and place it on the action bar. This toogle
is known as actionBarToggle. Add the addDrawerListener( ) method on the toggle, to add
click listener to it. Sync the toggle with the navigation drawer.use the
onOptionsItemSelected( ) method to add a click listner to the action bar. Use the
openDrawer( ) method and set the gravity to ‘start’ to make the drawer open from the left
side of the app.
In siple word Hamburger icon helps in open a screen which have many shortcurts. Whenever
we click on this a drawer slides from left or right (depands upon our code) containg many
clickable widgets. The following image shows the hamburger icon & its working.

Fig 2.6
2.10 Fragments:
Android introduce fragment in Android 3.0 (API level 11), primarly to support more dynamic
and flexible UI design on large screens, such as tablets. Because a tablet’s screen is much
larger than that of a handset, there’s more room to combine and interchange UI components.
A fragment is moduler section of an activity, which has its own lifecycle, receives its own
userinputs due to the user intracting independently with it.
A Fragment represents a behavior or a portion of user interface in a FragmentActivity. You
can combine multiple fragments in a single activity to build a multi-pane UI and reuse a
fragment in multiple activities. You can think of a fragment as a modular section of an
activity, which has its own lifecycle, receives its own input events, and which you can add or
remove while the activity is running (sort of like a "sub activity" that you can reuse in
different activities).

13
2.10.1 Fragment Transaction:
Any action that we perform to open or close a fragment is known as a fragment transaction.
Each fragment transaction is stored inside a back stack, which is maintained by the activity.
Whenever we open a new fragment the old one goes into the back stack.
The following flow chart gives information about whole fragment transaction-:

Fig 2.7

2.11 AppBarLayout:
An AppBarLayout is a vertical LinearLayout which implements many of the features of
material designs app bar concept, namely scrolling gestures. Children should provide their
desired scrolling behavior through setScrollFlags (int) or the associated layout XML
attribute-: app: laout_scrollFlags.
This view depends heavily on being used as a direct child within a CoordinatorLayout. If
you use AppBarLayout within a different ViewGroup, most of its functionality will not
work.

Fig 2.8

14
2.12 LayoutManager:
The LayoutManager is responsible for displaying the items of the list in a set pattern. There
are two LayoutManagers provided by Android.
2.12.1 LinearLayoutManager.
2.12.2 GridLayoutManager.

Fig 2.9

Fig 2.10

15
2.13 Adapter:
The adapter responsible for creating the view that the ViewHolder (the ViewHolder is
responsible for holding this View which is the same for each item of the list) holds. It also
binds the View with data. It assigns positions to different rows and uses the positions to
assign data to different rows. The total count of the items in a list is handled by the Adapter.
The Adapter serves as a bridge between data and the view.

2.14 HTTP:
HTTP stands for Hyper-Text Transfer Protocol. It is designed to enable communication
between clients and servers. In our case, our app will be client.

2.15 Activity:
An activity is a screen on your devices, which consists of the user interface. An activity
provides the window in which the app draws its UI. An activity has different states, like
create, pause, stop, destroy, etc. These states are attained by an activity because of some
events. An activity has different events like creation, pausing, destroying, etc. These events
are triggered by user interaction. When an activity enters a particular state, the method related
to the state is called. All this goes on in accordance with activity lifecycle.

Fig 2.11
2.16 setOnClickListener:
This function is used to enable clicks on the buttons. That means without using this function
we cannot implement any function on button. For ex in Face book login page, there is a
button named as Login, so whenever we click on it does two function first one is, when
password is wrong it shows a dialog box having massage ‘incorrect password’ or may be
other massage. In other condition it brings us on homepage. Without setOnClickListener
buttons have no function.
By this we can convert a simple text into clickable text for ex ‘forgot password’

16
Event listeners (setOnClickListener) simply enable us, or our code, to listen to an event. An
event is anything that the user does on the app, such as clicking a button or a link.

2.17 Classes & Inheritances:


Kotlin's object model is substantially different from Python's. Most importantly, classes
are not dynamically modifiable at runtime! (There are some limited exceptions to this, but
you generally shouldn't do it. However, it is possible to dynamically inspect classes and
objects at runtime with a feature called reflection - this can be useful, but should be
judiciously used.) All properties (attributes) and functions that might ever be needed on a
class must be declared either directly in the class body extension functions, so we should think
carefully through your class design.
Classes in Kotlin are declared using the keyword class:
class Invoice { /*...*/ }

2.17.1 Constructors:
A class in Kotlin can have a primary constructor and one or more secondary constructors.
The primary constructor is part of the class header: it goes after the class name (and optional
type parameters). If the primary constructor does not have any annotations or visibility
modifiers, the constructor keyword can be omitted. The primary constructor cannot contain
any code. Initialization code can be placed in initializer blocks, which are prefixed with
the init keyword. During an instance initialization, the initializer blocks are executed in the
same order as they appear in the class body, interleaved with the property initializers.

2.17.2 Secondary Constructors:


The class can also declare secondary constructors, which are prefixed with constructor:

class Person {

var children: MutableList<Person> = mutableListOf<>()

constructor(parent: Person) {

parent.children.add(this)

}
2.17.3 Inheritance:
Kotlin supports single-parent class inheritance - so each class (except the root class Any) has
got exactly one parent class, called a superclasses . Kotlin wants you to think through your
class design to make sure that it's actually safe to subclasses it, so classes are closed by
default and can't be inherited from unless you explicitly declare the class to
be open or abstract. You can then subclass from that class by declaring a new class which
mentions its parent class after a colon:
17
2.17.4 Visibility modifiers

Kotlin allows you to enforce symbol visibility (which Python only does via underscore
conventions) via visibility modifiers, which can be placed on symbol declarations. If you
don't supply a visibility modifier, you get the default visibility level, which is public.
The meaning of a visibility modifier depends on whether it's applied to a top-level declaration
or to a declaration inside a class.

Fig 2.12
2.18 Error & Exception:
An Error is serious problem that does not let a program run. An Exception indicates
conditions that may or may not let the program run based on the execution of the program.

2.19 Database:
When you use a Room database, you query the database by defining and
calling Kotlin functions in your code. These Kotlin functions map to SQL queries. You
define those mappings in a DAO using annotations, and Room creates the necessary code.
Think of a DAO as defining a custom interface for accessing your database. Most apps have
data that needs to be kept, even after the user closes the app. For example, the app might store
a playlist, an inventory of game items, records of expenses and income, a catalog of
constellations, or sleep data over time. Commonly, you would use a database to store
persistent data.

Room is a database library that's part of Android Jetpack. Room takes care of many of the
chores of setting up and configuring a database, and makes it possible for your app to interact
with the database using ordinary function calls. Under the hood, Room is an abstraction layer
on top of an SQLite database. Room’s terminology, and the query syntax for more complex
queries, follows the SQLite model. The image below shows how the Room database fits in
with the overall architecture recommended in this course.

18
Fig 2.13

2.20 Relational Database:

A relational database is used to store pieces of data that have some relation to each other. For
ex let assume a website having the data of some students which are interested in training or
internship. Now if a same student doing different training at the same time than it is difficult
to store the data. To resolve this we create 3 tables as follows-:

Fig 2.14

19
Files concept in Android
Before going to project that I made we need to know some basic concept of Android for
better understanding.
Since every project that we do in android studio must contain this file when we are doing
development in Kotlin:-


.kt file

.xml file

AndroidMenifest file

a. .kt File
Every android project in which user decided to carry out the project in Kotlin then
there is .kt file present in the every activity of the application Kotlin is just similar
to java, which replaces the java for the android application development and
become language to develop android apps. Kotlin remove boilerplates,
redundancy of code and it’s syntax are somewhat shorter than java.

Its saves with the extension .kt in android project basically we need a language to
connect the UI (xml file) to make the application dynamic so that application can
interact with user and get good UX( user experience).

It can also be carried out in java but nowadays Google is convincing developer to
shift from java to Kotlin to carry out the android project.

b. .xml File
It is used to define the actual User Interface of our application. We can open the
.xml from app -> res ->layout -> ActivityName.xml
We can find all the elements or the tools that we want to use in our project. It has
two different layouts i.e.; a coding layout where we can code for our required
elements needed like buttons, text views, etc. Or, we can directly drag and drop
the required
elements in the given design layout. The Android framework gives us the
flexibility to use either or both of these methods for declaring and managing our
apps UI.
In this article we will go through the basic concepts of xml in Android and
different XML files used for different purpose in Android. This will help you in
writing a UI code to design your desired user interface
c. Manifest File
As such, the name in the manifest's package attribute should always match your
project's base package name where you keep your activities and other app code.

20
However, beware that, once the APK is compiled, the package attribute also
represents your app's universally unique application ID. After the build tools perform
the above tasks based on the package name, they replace the package value with the
value given to the application Id property in your project's build.gradle file (used in
Android Studio projects). This final value for the package attribute must be
universally unique because it is the only guaranteed way to identify your app on the
system and in Google Play.

Android UI Widgets
There are lot off UI Controller/Widgets provided by Android, such as Button, TextView,
EditText, Checkbox, DatePicker, TimePicker, ProgressBar etc. These all allow you to
build GUI for Android App. Button: It's a User Interface Element from that user can tap
and perform Action.
Some of UI Widgets
a. Spinner
Spinners provide a quick way to select one value from a set. In the default state, a
spinner shows its currently selected value. Touching the spinner displays a
dropdown menu with all other available values, from which the user can select a
new one. Android Spinner is like the drop-down box of AWT or Swing.

b. Button
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.

21
Android Version

1. Android 1.0, 1.1(Base, Base_1_1)


2. Android 1.5(Cupcake)

3. Android 1.6(Donut)
4. Android 2.0(Eclair)

5. Android 2.0.1(Eclair_0_1)
6. Android 2.1.x(Eclair_MR1)

7. Android 2.2.x(Froyo)
8. Android 2.3 - 2.3.2(Gingerbread)

9. Android 2.3.3 - 2.3.4(Gingerbread_MR1)


10. Android 3.0.x, 3.1.x, 3.2(Honey_comb, HC _MR1, HC_Mr2)

11. Android 4.0 - 4.0.2, 4.0.3 - 4.0.4((Ice_Cream_Sandwich, ICS_MR1)


12. Android 4.1 - 4.1.1, 4.2 - 4.2.2,4.3(Jelly_bean, JB_MR1, JB_MR2)

13. Android 4.4, 4.4W (Kit_Kat, K_Wacha)


14. Android 5.0, 5.1(Lollipop, L_MR1)

15. Android 6.0 (Marshmallow)


16. Android 7.0 (Nougat)

17. Android 8.0 Oreo (API 26)


18. Android 9 Pie (API 28)

19. Android 10 (API 29)


20. Android 11 (API 30)

Currently Last update from android id Android 11(API 29), which released on 8 Sep.
2020.
Pie 9.0 (API 26) was the most popular version of Android operating system as of April
2020. Despite being released in the fall of 2015. Marshmallow 6.0 was still the second
most widely used version of Android's operating system on smartphone devices as of
then.

22
Services
A service is an application component that can perform long-running operations in
the background. It does not provide a user interface. Once started, a service might
continue running for some time, even after the user switches to another
application.

Additionally, a component can bind to a service to interact with it and even


perform inter-process communication (IPC). For example, a service can handle
network transactions, play music, perform file I/O, or interact with a content
provider, all from the background.

A service is simply a component that can run in the background, even when the
user is not interacting with your application, so you should create a service only if
that is what you need.

If you must perform work outside of your main thread, but only while the user is
interacting with your application, you should instead create a new thread in the
context of another application component. For example, if you want to play some
music, but only while your activity is running, you might create a thread in
onCreate (), start running it in onStart (), and stop it in onStop (). Also consider
using thread pools and executors from the java.utils.cocurrent package or Kotlin
coroutines instead of the traditional Thread class. See the Threading on Android
document for more information about moving execution to background threads.

Broadcast receiver

Android apps can send or receive broadcast messages from the Android system
and other Android apps, similar to the publish-subscribe design pattern. These
broadcasts are sent when an event of interest occurs. For example, the Android
system sends broadcasts when various system events occur, such as when the
system boots up or the device starts charging.

Apps can also send custom broadcasts, for example, to notify other apps of
something that they might be interested in (for example, some new data has been
downloaded).

Apps can register to receive specific broadcasts. When a broadcast is sent, the
system automatically routes broadcasts to apps that have subscribed to receive that
particular type of broadcast.

Generally speaking, broadcasts can be used as a messaging system across apps


and outside of the normal user flow. However, you must be careful not to abuse
the opportunity to respond to broadcasts and run jobs in the background that can
contribute to a slow system performance, as described in the following video.

23
The system automatically sends broadcasts when various system events occur,
such as when the system switches in and out of airplane mode. System broadcasts
are sent to all apps that are subscribed to receive the event.

The broadcast message itself is wrapped in an Intent object whose action


string
Identifies the event that occurred (for example
android.intent.action.AIRPLANEMODE). The intent may also include additional
information bundled into its extra field. For example, the airplane mode intent
includes a Boolean extra that indicates whether or not Airplane Mode is on. For
more information about how to read intents and get the action string from intent,
see Intents and Intent Filters.

24
REFERENCES

Following are the links from which all the information has been taken:


https://developer.android.com/training/basics/index.html

https://developer.android.com/training/basics/concept/creatin
g-project.html

➢ http://www.hiddenbrains.com/android-application-development.html

➢ http://www.letsnurture.com/services/mobile/android-
mobile-application-devel opment.html

➢ https://www.tutorialspoint.com/android/

➢ Android Power: http://blogs.computerworld.com/raphael

➢ The Droid Guy: http://thedroidguy.com/

➢ Phandroid: http://phandroid.com/

➢ Android Guys: http://www.androidguys.com/

➢ CW:
http://www.computerworld.com/s/article/9178688/Android_news_reviews_mor e
➢ Introduction to Android: http://developer.android.com/guide/index.html.

➢ Android API: http://developer.android.com/reference/packages.html

➢ Java 6 API: http://docs.oracle.com/javase/6/docs/api/


Android

Fundamentals:
http://developer.android.com/guide/components/fundamentals.html

➢ The Java Tutorials: http://docs.oracle.com/javase/tutorial/

➢ Android User Interfaces: http://developer.android.com/guide/topics/ui/index.html

25
➢ Layout: http://developer.android.com/guide/topics/ui/declaring-layout.html

➢ Common Tasks: http://developer.android.com/guide/appendix/faq/commontasks.html


➢ Google Maps: http://code.google.com/android/add-ons/google-
apis/maps-overview.html
➢ Iconography:
http://developer.android.com/guide/practices/ui_guidelines/icon_design

.html

➢ Sample Source Code:


http://developer.android.com/resources/samples/get.html

➢ Android Training: http://developer.android.com/training/index.html.

➢ Android Developer's Blog: http://android-developers.blogspot.com/

➢ Developer FAQ: http://developer.android.com/resources/faq/

➢ Developer Forums: http://developer.android.com/resources/community-groups.html

➢ Android Developer's Group:


http://groups.google.com/group/android-developers?lnk=
➢ XDA-Developers Forums: http://forum.xda-developers.com/

26
27

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy