SlideShare uma empresa Scribd logo
1 de 57
Mobile: able to be moved from one place to
another
Mobile device is a general term for any
handheld computer or smartphone. Tablets,
e-readers, smartphones, PDAs, portable
music players, smartwatches, and fitness
trackers with smart capabilities are all mobile
devices.
A mobile phone, cellular phone, cell phone,
handphone, sometimes shortened to simply mobile,
cell or just phone, is a wireless handheld
device(portable telephone) that can make and
receive calls over a radio frequency link while the
user is moving within a telephone service area.
While the earliest generation of mobile phones could
only make and receive calls, today’s mobile phones
do a lot more, accommodating web browsers,
games, cameras, video players and navigational
systems.
A handheld mobile radio telephone service was envisioned
in the early stages of radio engineering. In 1917, Finnish
inventor Eric Tigerstedt filed a patent for a "pocket-size
folding telephone with a very thin carbon microphone".
Early predecessors of cellular phones included analog
radio communications from ships and trains.
The advances in mobile telephony have been traced in
successive "generations", starting with the early zeroth-
generation (0G) services, such as Bell System's Mobile
Telephone Service and its successor, the Improved Mobile
Telephone Service. These 0G systems were not cellular,
supported few simultaneous calls, and were very
expensive.
Like a computer operating system, a mobile operating system is the software
platform for mobile devices on top of which other programs run.
iOS
An operating system from Apple, was originally developed for the iPhone. Later it
was extended to support iPod Touch, iPad and Apple TV. Apple’s App Store
contains more than 500,000 applications and have more than 25 billion
downloads collectively. It holds the reputation of intelligent UI creator which is
based on the concept of direct manipulation, using multi-touch gestures.
Android
It is a Linux based mobile operating system developed by the Open Handset
Alliance led by Google. Android boasts large community of developers writing
applications extending the functionality of the devices. It has 450,000 apps in
its Android Market and download exceeds 10 billion count.
BlackBerry OS
It is developed by Research In Motion (RIM) for its line of smartphones.
This operating system is known for its native support for corporate e-
mail through MIDP allowing complete wireless activation and
synchronization with Microsoft Exchange and Lotus Domino.
Accordingly to one research approximately 45% of mobile developers
were using the platform at the time of publication. It provides
BlackBerry API classes for developers to write applications.
Windows Phone
A successor to Windows Mobile platform, Windows Phone, is a mobile
operating system launched by Microsoft in late 2010. This mobile OS
is targeted at consumer market. With this new operating system
Microsoft offered a new user interface, Metro, integrating the operating
system with third party and other Microsoft services, and controls the
hardware on which it runs.
Mobile Programming(application development) is the
process to making software for smartphones and digital
assistants, most commonly for Android and iOS. The
software can be preinstalled on the device, downloaded
from a mobile app store or accessed through a mobile
web browser. The programming and markup languages
used for this kind of software development include
Java,Kotlin Swift, C# and HTML5.
There are four major development approadches when
building mobile applications.
 Native Mobile Applications
 Cross-Platform Native Mobile Applications
 Hybrid Mobile Applications
 Progressive Web Applications
A native app is a platform-specific app that is
capable of running only on a particular operating
system. In other words, the business would have to
develop apps differently for iOS and Android (i.e., to
launch an app on both platforms, it will have to be
coded twice).
Building a native application is expensive (for
obvious reasons). However, the app is often better
in performance and offers a good user experience.
A cross-platform app is coded once and is
compatible to run on multiple platforms. In
other words, there is a single, unified code
that works for both Android and iOS apps.
Cross-platform apps are cheaper to build
owing to its platform independent attribute.
A hybrid app is a blend of a native mobile app
and a web app. In technical terms, a web
application put into a native shell is a hybrid
app. These apps are built in a native container
but, when downloaded, they showcase content
similar to that of a web app.
These apps are easier and faster to develop but
might lead to performance issues.
A progressive web app (PWA) is a web
application that offers a native app-like user
experience. The best part is that a PWA runs
on the web, which implies that the user does
not need to install a separate app for it. The
upshot of PWAs are that they consume less
data, perform better, and increase
engagement rates.
There are two interlinked core components of
a mobile application: 1) the mobile
application "Front-End" that resides on the
mobile device, and 2) the services "Back-
End" that supports the mobile front-end.
In the early days of the modern smartphone applications era, mobile
applications went through a similar evolution as first websites. At first, the
applications and sites where wholly contained within themselves and acted
as little more than static advertisements for the brand, company, product,
or service.
However, as connectivity and network capabilities improved, the
applications became increasingly connected to sources of data and
information that lived outside of the app itself, and the apps became
increasingly dynamic as they were able to update their UI and content with
data received over the network from queries to data sources.
As a result, the mobile front-end applications increasingly rely on and
integrated with back-end services which provide data to be consumed
through the mobile front-end. Such data can include, for example, product
information for e-commerce apps or flight info for travel and reservation
apps. For a mobile game, the data may include new levels or challenges
and scores or avatars from other players.
Android is a mobile operating system based on a modified version of the
Linux kernel and other open source software, designed primarily for
touchscreen mobile devices such as smartphones and tablets. Android
is developed by a consortium of developers known as the Open
Handset Alliance and commercially sponsored by Google. It was
unveiled in November 2007, with the first commercial Android device,
the HTC Dream, being launched in September 2008.
It is free and open-source software; its source code is known as Android
Open Source Project (AOSP), which is primarily licensed under the
Apache License. However most Android devices ship with additional
proprietary software pre-installed,[14] most notably Google Mobile
Services (GMS) which includes core apps such as Google Chrome,
the digital distribution platform Google Play, and associated Google
Play Services development platform.
The history and versions of android are interesting to know. The code names of android ranges from
A to J currently, such as Aestro, Blender, Cupcake, Donut, Eclair, Froyo, Gingerbread,
Honeycomb, Ice Cream Sandwitch, Jelly Bean, KitKat and Lollipop.
1) Initially, Andy Rubin founded Android Incorporation in Palo Alto, California, United States in
October, 2003.
2) In 17th August 2005, Google acquired android Incorporation. Since then, it is in the subsidiary of
Google Incorporation.
3) The key employees of Android Incorporation are Andy Rubin, Rich Miner, Chris White and Nick
Sears.
4) Originally intended for camera but shifted to smart phones later because of low market for camera
only.
5) Android is the nick name of Andy Rubin given by coworkers because of his love to robots.
6) In 2007, Google announces the development of android OS.
7) In 2008, HTC launched the first android mobile.
1) Linux kernel
It is the heart of android architecture that exists at the root of android architecture.
Linux kernel is responsible for device drivers, power management, memory
management, device management and resource access.
2) Native Libraries
On the top of linux kernel, their are Native libraries such as WebKit, OpenGL,
FreeType, SQLite, Media, C runtime library (libc) etc.
The WebKit library is responsible for browser support, SQLite is for database,
FreeType for font support, Media for playing and recording audio and video
formats.
3) Android Runtime
In android runtime, there are core libraries and DVM (Dalvik Virtual Machine) which
is responsible to run android application. DVM is like JVM but it is optimized for
mobile devices. It consumes less memory and provides fast performance.
4) Android Framework
On the top of Native libraries and android runtime, there is android
framework. Android framework includes Android API's such as
UI (User Interface), telephony, resources, locations, Content
Providers (data) and package managers. It provides a lot of
classes and interfaces for android application development.
5) Applications
On the top of android framework, there are applications. All
applications such as home, contact, settings, games, browsers
are using android framework that uses android runtime and
libraries. Android runtime and native libraries are using linux
kernal.
A view hierarchy defines the relationships of views in a
window to each other. You can think of a view hierarchy as
an inverted tree structure with the window being the top
node of the tree. Under it come views structurally specified
by parent-child relationships. From a visual perspective,
the essential fact of a view hierarchy is enclosure: one
view contains one or more other views, and the window
contains them all.
The view hierarchy is also the governing concept behind
view composition: You construct compound views by
adding subviews to a superview. Finally, the view hierarchy
is a critical factor in the multiple coordinate systems found
in a window.
A layout defines the structure for a user interface in your
app, such as in an activity. All elements in the layout
are built using a hierarchy of View and ViewGroup
objects. A View usually draws something the user
can see and interact with. Whereas a ViewGroup is
an invisible container that defines the layout structure
for View and other ViewGroup objects, as shown in
figure
The View objects are usually called "widgets" and can be one of many
subclasses, such as Button or TextView. The ViewGroup objects are
usually called "layouts" can be one of many types that provide a
different layout structure, such as LinearLayout or ConstraintLayout .
You can declare a layout in two ways:
Declare UI elements in XML. Android provides a straightforward XML
vocabulary that corresponds to the View classes and subclasses, such
as those for widgets and layouts.
You can also use Android Studio's Layout Editor to build your XML layout
using a drag-and-drop interface.
Instantiate layout elements at runtime. Your app can create View and
ViewGroup objects (and manipulate their properties) programmatically.
Linear Layout
LinearLayout is a view group that aligns all children in a single direction,
vertically or horizontally.
Relative Layout
RelativeLayout is a view group that displays child views in relative positions.
Table Layout
TableLayout is a view that groups views into rows and columns.
Absolute Layout
AbsoluteLayout enables you to specify the exact location of its children.
Frame Layout
The FrameLayout is a placeholder on screen that you can use to display a
single view.
Scroll Layout
ListView is a view group that displays a list of scrollable items.
Grid View
GridView is a ViewGroup that displays items in a two-dimensional, scrollable
grid.
We use this layout to place the elements in a linear manner. A Linear
manner means one element per line. This layout creates various
kinds of forms on Android. In this, arrangement of the elements is in
a top to bottom manner.
This can have two orientations:
a. Vertical Orientation – It is shown above where the widgets such as
TextViews, and all in a vertical manner.
b. Horizontal Orientation – It is shown above where the widgets such
as TextViews, and all in a horizontal manner.
A LinearLayout respects margins between children and the gravity (right,
center, or left alignment) of each child.
Most important attribute of the LinearLayout is orientation
android:orientation="vertical"or android:orientation="horizontal"
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:orientation="vertical" >
....
...
</LinearLayout>
Dp: density independent pixel
The basic building block for user interface is a View object
that is created from the View class and occupies a
rectangular area on the screen. Views are the base
class for UI components like TextView, Button, EditText
etc.
The ViewGroup is a subclass of View. One or more Views
can be grouped together into a ViewGroup. A
ViewGroup provides the android layout in which we can
order the appearance and sequence of views.
Examples of ViewGroup are LinearLayout,
FrameLayout, RelativeLayout etc.
Android provides the following ViewGroups or layouts:
LinearLayout : is a ViewGroup that aligns all children in a single direction, vertically
or horizontally
RelativeLayout : is a ViewGroup that displays child views in relative positions
AbsoluteLayout : allows us to specify the exact location of the child views and
widgets
TableLayout : is a view that groups its child views into rows and columns
FrameLayout : is a placeholder on screen that is used to display a single view
ScrollView : is a special type of FrameLayout in that it allows users to scroll through
a list of views that occupy more space than the physical display. The
ScrollView can contain only one child view or ViewGroup, which normally is a
LinearLayout
ListView : is a view group that displays a list of scrollable item
GridView : is a ViewGroup that displays items in two-dimensional scrolling grid. The
items in the grid come from the ListAdapter associated with this view
android:id : This is the ID which uniquely identifies the view
android:layout_width : This is the width of the layout
android:layout_height : This is the height of the layout
android:layout_margin : This is the extra space outside of the view. For example if
you give android:marginLeft=20dp, then the view will be arranged after 20dp
from left
android:layout_padding : This is similar to android:layout_margin except that it
specifies the extra space inside the view
android:layout_gravity : This specifies how child Views are positioned(left,right,
center, center-horizontal)
android:layout_weight : This specifies how much of the extra space in the layout
should be allocated to the view
android:layout_x : This specifies the x-coordinate of the layout
android:layout_y : This specifies the y-coordinate of the layout
android:layout_width=wrap_content tells the view to size itself to the dimensions
required by its content.
android:layout_width=match_parent tells the view to become as big as its parent
view.
Android LinearLayout organizes elements along a single line. We can
specify whether that line is vertical or horizontal using
android:orientation. The orientation is horizontal by default.
A vertical LinearLayout will only have one child per row (so it is a
column of single elements), and a horizontal LinearLayout will only
have one single row of elements on the screen.
android:layout_weight attribute depicts the importance of the element.
An element with larger weight occupies more screen space.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<Button android:id="@+id/btn1"
android:layout_width="270dp"
android:layout_height="wrap_content"
android:text="Button1"/>
<Button android:id="@+id/btn2"
android:layout_width="270dp"
android:layout_height="wrap_content"
android:text="Button2"/>
<Button android:id="@+id/btn3"
android:layout_width="270dp"
android:layout_height="wrap_content"
android:text="Button3"/>
</LinearLayout>
RelativeLayout is a view group that displays child views in relative
positions. The position of each view can be specified as relative to
sibling elements (such as to the left-of or below another view) or in
positions relative to the parent RelativeLayout area (such as aligned to
the bottom, left of center).
For example in a class, if a Student A is sitting on a chair and the teacher
of the class asks Student B to sit to the right of the Student A. Student
B will know where he/she has to sit.
A RelativeLayout is a very powerful utility for designing a user interface
because it can eliminate nested view groups and keep your layout
hierarchy flat, which improves performance. If you find yourself using
several nested LinearLayout groups, you may be able to replace them
with a single RelativeLayout.
Center relative to Parent View
When you want to place your Views in the center relative to the parent,
you can use the following 3 attributes:
android:layout_centerHorizontal="true"
This places the view horizontally in the center of the parent. As our parent
view covers the whole screen of mobile therefore the view gets placed
in the middle of the mobile screen horizontally. (See the yellow view in
the above figure)
android:layout_centerVertical="true"
This places the view vertically in the center of the parent. Since the parent
view covers the whole screen of mobile hence the view gets placed in
the middle of the mobile screen vertically. (See the blue view in the
above figure)
android:layout_centerInParent="true"
This attribute will place the view in the center of the parent. Since the
parent in our example covers the whole screen of mobile, so the view
gets placed in the middle of the mobile screen, both horizontally and
vertically.
Align by the parent view
android:layout_alignParentTop="true"
If you write this attribute for a View, then that view will stick to the top of its parent. Since the parent
covers the whole screen of mobile therefore, the view will appear sticking to the top-left of the
mobile screen.
android:layout_alignParentBottom="true"
If you write this attribute for a View, then that view will stick to the bottom of its parent. Since the our
parent covers the whole screen of mobile therefore, the view will appear sticking to the bottom of
the mobile screen.
android:layout_alignParentLeft="true"
If you write this attribute for a View, then that view will stick to the left of its parent. Since the parent in
our example covers the whole screen of mobile therefore, the view will appear sticking to the left
of the mobile screen.
android:layout_alignParentRight="true"
If you write this attribute for a View, then that view will stick to the right of its parent.
Note: You can always use more than one of these attributes. Suppose you use
android:layout_alignParentLeft="true" and android:layout_alignParentBottom="true", then the
view will stick to the bottom-left corner of the screen
Align new View relative to existing sibling View
If you want to align the new view relative to any existing view, then you can use the
following attributes.
Relative Layout in Android
android:layout_alignTop="@id/a"
This aligns the top margin of the new view with the top margin of the view having id as a.
android:layout_alignBottom="@id/a"
This aligns the bottom margin of the new view with the bottom margin of the view having
id as a.
android:layout_alignLeft="@id/a"
This aligns the left margin of the new view with the left margin of the view having id as a.
android:layout_alignRight="@id/a"
This aligns the right margin of the new view with the right margin of the view having id as
a.
android:layout_alignBaseLine="@id/a"
This aligns the text1 of the new view with the text2 of the view having id as a.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFEB3B"
tools:context="com.example.myapplication.RelativeActivity">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:textStyle="bold"
android:textAllCaps="true"
android:textSize="17sp"
android:text="Two Button will use me as a reference" />
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Aligned to thensecond button"
android:layout_below="@+id/textView"
android:layout_alignLeft="@+id/textView"
android:layout_margin="5dp"
android:layout_alignStart="@+id/textView" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Aligned to thenfirst button"
android:layout_toRightOf="@id/button"
android:layout_alignTop="@id/button"
android:layout_below="@+id/textView"
android:layout_marginRight="21dp"
android:layout_marginEnd="21dp" />
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/button"
android:layout_alignStart="@+id/button"
android:layout_below="@+id/button"
android:layout_marginTop="70dp"
android:textStyle="bold|italic"
android:textSize="20sp"
android:textColor="#25c"
android:text="I want to align by basenline with you" />
<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/textView5"
android:layout_alignTop="@+id/textView5"
android:layout_margin="10dp"
android:textSize="20sp"
android:textStyle="bold|italic"
android:textColor="#25c"
android:layout_marginTop="70dp"
android:layout_alignBaseline="@id/textView5"
android:text="Okay,let me use the attribute" />
<TextView
android:id="@+id/textView4"
A TableLayout is a ViewGroup that arranges its children i.e Views and
other Layouts in a table form with rows and columns. To define a
row, you can use <TableRow> tag inside this layout.
There is no need to mention number of columns in a TableLayout
because Android automatically adds columns as per the number of
views and other layouts added in a table row.
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
android:background="#FFFF00">
<!-- first row -->
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:background="@color/colorAccent">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="NAME"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<EditText
android:id="@+id/edtName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Enter you name"
android:inputType="textPersonName"/>
</TableRow>
<!-- second row -->
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:background="#0091EA">
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Password"
android:textAllCaps="true"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<EditText
android:id="@+id/edtPwd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Enter your Password"
android:inputType="textPassword"/>
An Absolute Layout allows you to specify the exact location .i.e., X and Y coordinates of
its children with respect to the origin at the top left corner of the layout. The absolute
layout is less flexible and harder to maintain for varying sizes of screens.
Some of the important Absolute Layout attributes are the following:
android:id: It uniquely specifies the absolute layout
android:layout_x: It specifies X-Coordinate of the Views (Possible values of this is in
density-pixel or pixel)
android:layout_y: It specifies Y-Coordinate of the Views (Possible values of this is in dp
or px)
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
tools:context=".MainActivity">
<!--Setting up TextViews-->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="100px"
android:layout_y="300px" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="120px"
android:layout_y="350px" />
</AbsoluteLayout>
Constraint Layout is a ViewGroup (i.e. a view that holds other
views) which allows you to create large and complex layouts
with a flat view hierarchy, and also allows you to position and
size widgets in a very flexible way. It was created to help reduce
the nesting of views and also improve the performance of layout
files.
Constraint Layout Example In Android Studio
ConstraintLayout is very similar to RelativeLayout in such a way
because, views are laid out according to relationships between
sibling views and the parent layout yet it’s a lot more flexible and
works better with the Layout Editor of the Android Studio’s. It
was released at Google I/O 2016. Since it came into existence
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="https://schemas.android.com/apk/res/android"
xmlns:app="https://schemas.android.com/apk/res-auto"
xmlns:tools="https://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:text="TextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView"
android:layout_marginStart="16dp"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginLeft="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:text="TextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView2"
app:layout_constraintBaseline_toBaselineOf="@+id/textView"
android:layout_marginStart="16dp"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginLeft="16dp"
app:layout_constraintRight_toLeftOf="@+id/textView"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp" />
</android.support.constraint.ConstraintLayout>
An activity is referred to as one screen in an application. It
is very similar to a single window of any desktop
application. An Android app consists of one or more
screens or activities.
Each activity goes through various stages or a lifecycle
and is managed by activity stacks. So when a new
activity starts, the previous one always remains below it.
If an activity is in the foreground of the screen i.e at the top of the stack,
then it is said to be active or running. This is usually the activity that
the user is currently interacting with.
If an activity has lost focus and a non-full-sized or transparent activity has
focused on top of your activity. In such a case either another activity
has a higher position in multi-window mode or the activity itself is not
focusable in the current window mode. Such activity is completely
alive.
If an activity is completely hidden by another activity, it is stopped or
hidden. It still retains all the information, and as its window is hidden
thus it will often be killed by the system when memory is needed
elsewhere.
The system can destroy the activity from memory by either asking it to
finish or simply killing its process. When it is displayed again to the
user, it must be completely restarted and restored to its previous state.
It is called when the activity is first created. This is where all the static work is
done like creating views, binding data to lists, etc. This method also
provides a Bundle containing its previous frozen state, if there was one.
@override
protected void onCreate(Bundle savedInstanceState)
{
....
Toast toast = Toast.makeText(getApplicationContext(), "onCreate Called",
Toast.LENGTH_LONG).show();
}
It is invoked when the activity is visible to the user. It is
followed by onResume() if the activity is invoked from the
background. It is also invoked after onCreate() when the
activity is first started.
@override
protected void onStart()
{
// It will show a message on the screen
// then onStart is invoked
Toast toast = Toast.makeText(getApplicationContext(),
"onStart Called", Toast.LENGTH_LONG).show();
}
It is invoked after the activity has been stopped and prior to its starting
stage and thus is always followed by onStart() when any activity is
revived from background to on-screen.
@override
protected void onRestart() {
// It will show a message on the screen
// then onRestart is invoked
Toast toast = Toast.makeText(getApplicationContext(), "onRestart
Called", Toast.LENGTH_LONG).show();
}
It is invoked when the activity starts interacting with the user. At this
point, the activity is at the top of the activity stack, with a user
interacting with it. Always followed by onPause() when the activity
goes into the background or is closed by the user.
protected void onResume() {
// It will show a message on the screen
// then onResume is invoked
Toast toast = Toast.makeText(getApplicationContext(),
"onResume Called", Toast.LENGTH_LONG).show();
}
It is invoked when an activity is going into the background but has
not yet been killed. It is a counterpart to onResume(). When an
activity is launched in front of another activity, this callback will
be invoked on the top activity (currently on screen). The activity,
under the active activity, will not be created until the active
activity’s onPause() returns, so it is recommended that heavy
processing should not be done in this part.
protected void onPause() {
// It will show a message on the screen
// then onPause is invoked
Toast toast = Toast.makeText(getApplicationContext(),
"onPause Called", Toast.LENGTH_LONG).show();
}
@Override
protected void onStop() {
super.onStop();
// The activity is no longer visible (it is now "stopped")
}
 This method is called when the Activity is no longer visible in the app.
 It can happen, for example, when another Activity has been loaded and is taking the full screen of the
device.
 When this method is called, the Activity is said to be in a stopped state.
 In this state, the system either calls the onRestart() to bring back interactivity with Activity. Or it calls
the onDestroy() method to destroy the Activity.
The final call received before the activity is destroyed. This can happen either
because the activity is finishing (when finish() is invoked) or because the
system is temporarily destroying this instance of the activity to save space.
To distinguish between these scenarios, check it with isFinishing() method.
protected void onDestroy() {
// It will show a message on the screen
// then onDestroy is invoked
Toast toast = Toast.makeText(getApplicationContext(), "onDestroy
Called", Toast.LENGTH_LONG).show();
}

Mais conteúdo relacionado

Mais procurados

CNIT 128 Ch 1: The mobile risk ecosystem
CNIT 128 Ch 1: The mobile risk ecosystemCNIT 128 Ch 1: The mobile risk ecosystem
CNIT 128 Ch 1: The mobile risk ecosystemSam Bowne
 
Mobile Ecosystem Dynamics (CTO Briefing)
Mobile Ecosystem Dynamics (CTO Briefing)Mobile Ecosystem Dynamics (CTO Briefing)
Mobile Ecosystem Dynamics (CTO Briefing)Paul Golding
 
Mobile Ecosystem
Mobile EcosystemMobile Ecosystem
Mobile EcosystemPragati Rai
 
Evolution of the Mobile Ecosystem
Evolution of the Mobile EcosystemEvolution of the Mobile Ecosystem
Evolution of the Mobile EcosystemKathy Gill
 
Designing Content for Multiple Devices
Designing Content for Multiple DevicesDesigning Content for Multiple Devices
Designing Content for Multiple DevicesBrandon Carson
 
IRJET - Android based Mobile Forensic and Comparison using Various Tools
IRJET -  	  Android based Mobile Forensic and Comparison using Various ToolsIRJET -  	  Android based Mobile Forensic and Comparison using Various Tools
IRJET - Android based Mobile Forensic and Comparison using Various ToolsIRJET Journal
 
Mobile Accessibility Best Practices & Trends
Mobile Accessibility Best Practices & TrendsMobile Accessibility Best Practices & Trends
Mobile Accessibility Best Practices & TrendsAidan Tierney
 
Dark Clouds and Rainy Days, the Bad Side of Cloud Computing
Dark Clouds and Rainy Days, the Bad Side of Cloud ComputingDark Clouds and Rainy Days, the Bad Side of Cloud Computing
Dark Clouds and Rainy Days, the Bad Side of Cloud ComputingDavid Rogers
 
Developing Secure Mobile Applications
Developing Secure Mobile ApplicationsDeveloping Secure Mobile Applications
Developing Secure Mobile ApplicationsDenim Group
 
Andrew Jaquith SOURCE Boston 2011
Andrew Jaquith SOURCE Boston 2011Andrew Jaquith SOURCE Boston 2011
Andrew Jaquith SOURCE Boston 2011Source Conference
 
CIS14: Mobilize Your Workforce with Secure Identity Services
CIS14: Mobilize Your Workforce with Secure Identity ServicesCIS14: Mobilize Your Workforce with Secure Identity Services
CIS14: Mobilize Your Workforce with Secure Identity ServicesCloudIDSummit
 
IRJET- Android Device Attacks and Threats
IRJET-  	  Android Device Attacks and ThreatsIRJET-  	  Android Device Attacks and Threats
IRJET- Android Device Attacks and ThreatsIRJET Journal
 
Mobile Device Security
Mobile Device SecurityMobile Device Security
Mobile Device SecurityJohn Rhoton
 
Android Application Development
Android Application DevelopmentAndroid Application Development
Android Application DevelopmentGokhan Arik
 
Mobile CMS - CMSExpo 2010
Mobile CMS - CMSExpo 2010Mobile CMS - CMSExpo 2010
Mobile CMS - CMSExpo 2010Tom Deryckere
 
Securing Mobile Banking Apps - You Are Only as Strong as Your Weakest Link
Securing Mobile Banking Apps - You Are Only as Strong as Your Weakest LinkSecuring Mobile Banking Apps - You Are Only as Strong as Your Weakest Link
Securing Mobile Banking Apps - You Are Only as Strong as Your Weakest LinkIBM Security
 
Kaspars Petersons - BYOD - more like BYOP
Kaspars Petersons -  BYOD - more like BYOPKaspars Petersons -  BYOD - more like BYOP
Kaspars Petersons - BYOD - more like BYOPDevConFu
 

Mais procurados (20)

CNIT 128 Ch 1: The mobile risk ecosystem
CNIT 128 Ch 1: The mobile risk ecosystemCNIT 128 Ch 1: The mobile risk ecosystem
CNIT 128 Ch 1: The mobile risk ecosystem
 
POWERPOINT2
POWERPOINT2POWERPOINT2
POWERPOINT2
 
Mobile Ecosystem Dynamics (CTO Briefing)
Mobile Ecosystem Dynamics (CTO Briefing)Mobile Ecosystem Dynamics (CTO Briefing)
Mobile Ecosystem Dynamics (CTO Briefing)
 
Mobile Ecosystem
Mobile EcosystemMobile Ecosystem
Mobile Ecosystem
 
Evolution of the Mobile Ecosystem
Evolution of the Mobile EcosystemEvolution of the Mobile Ecosystem
Evolution of the Mobile Ecosystem
 
Designing Content for Multiple Devices
Designing Content for Multiple DevicesDesigning Content for Multiple Devices
Designing Content for Multiple Devices
 
Smart phones
Smart phonesSmart phones
Smart phones
 
IRJET - Android based Mobile Forensic and Comparison using Various Tools
IRJET -  	  Android based Mobile Forensic and Comparison using Various ToolsIRJET -  	  Android based Mobile Forensic and Comparison using Various Tools
IRJET - Android based Mobile Forensic and Comparison using Various Tools
 
Mobile Accessibility Best Practices & Trends
Mobile Accessibility Best Practices & TrendsMobile Accessibility Best Practices & Trends
Mobile Accessibility Best Practices & Trends
 
Dark Clouds and Rainy Days, the Bad Side of Cloud Computing
Dark Clouds and Rainy Days, the Bad Side of Cloud ComputingDark Clouds and Rainy Days, the Bad Side of Cloud Computing
Dark Clouds and Rainy Days, the Bad Side of Cloud Computing
 
Developing Secure Mobile Applications
Developing Secure Mobile ApplicationsDeveloping Secure Mobile Applications
Developing Secure Mobile Applications
 
Andrew Jaquith SOURCE Boston 2011
Andrew Jaquith SOURCE Boston 2011Andrew Jaquith SOURCE Boston 2011
Andrew Jaquith SOURCE Boston 2011
 
CIS14: Mobilize Your Workforce with Secure Identity Services
CIS14: Mobilize Your Workforce with Secure Identity ServicesCIS14: Mobilize Your Workforce with Secure Identity Services
CIS14: Mobilize Your Workforce with Secure Identity Services
 
IRJET- Android Device Attacks and Threats
IRJET-  	  Android Device Attacks and ThreatsIRJET-  	  Android Device Attacks and Threats
IRJET- Android Device Attacks and Threats
 
Mobile Device Security
Mobile Device SecurityMobile Device Security
Mobile Device Security
 
Android Application Development
Android Application DevelopmentAndroid Application Development
Android Application Development
 
The Mobile Ecosystem
The Mobile EcosystemThe Mobile Ecosystem
The Mobile Ecosystem
 
Mobile CMS - CMSExpo 2010
Mobile CMS - CMSExpo 2010Mobile CMS - CMSExpo 2010
Mobile CMS - CMSExpo 2010
 
Securing Mobile Banking Apps - You Are Only as Strong as Your Weakest Link
Securing Mobile Banking Apps - You Are Only as Strong as Your Weakest LinkSecuring Mobile Banking Apps - You Are Only as Strong as Your Weakest Link
Securing Mobile Banking Apps - You Are Only as Strong as Your Weakest Link
 
Kaspars Petersons - BYOD - more like BYOP
Kaspars Petersons -  BYOD - more like BYOPKaspars Petersons -  BYOD - more like BYOP
Kaspars Petersons - BYOD - more like BYOP
 

Semelhante a Android App

Android Architecture and Working
Android Architecture and WorkingAndroid Architecture and Working
Android Architecture and WorkingAnkurVeer1
 
this is android development ppt.ppt
this is android development ppt.pptthis is android development ppt.ppt
this is android development ppt.pptDeveshChoube
 
Benefits of android phone.pptx
Benefits of android phone.pptxBenefits of android phone.pptx
Benefits of android phone.pptxNiranjanBehera35
 
Power point activity 2
Power point activity 2Power point activity 2
Power point activity 2ianoblepias
 
Introduction to mobile technology
Introduction to mobile technologyIntroduction to mobile technology
Introduction to mobile technologyGautam Krishnan
 
Introduction to Android | Android Tutorials | Android Blog - SearchforSolutio...
Introduction to Android | Android Tutorials | Android Blog - SearchforSolutio...Introduction to Android | Android Tutorials | Android Blog - SearchforSolutio...
Introduction to Android | Android Tutorials | Android Blog - SearchforSolutio...searchforsolutionsonline
 
Blending Creativity and Technology With Android App Development
Blending Creativity and Technology With Android App DevelopmentBlending Creativity and Technology With Android App Development
Blending Creativity and Technology With Android App Developmentamanraza23
 
Power point activity 2
Power point activity 2Power point activity 2
Power point activity 2ELaii Dancel
 
Power point activity 2
Power point activity 2Power point activity 2
Power point activity 2RancieCastro
 
Mobile Application Development-Lecture 01 & 02.pdf
Mobile Application Development-Lecture 01 & 02.pdfMobile Application Development-Lecture 01 & 02.pdf
Mobile Application Development-Lecture 01 & 02.pdfAbdullahMunir32
 

Semelhante a Android App (20)

Android introduction
Android introductionAndroid introduction
Android introduction
 
Android Architecture and Working
Android Architecture and WorkingAndroid Architecture and Working
Android Architecture and Working
 
Android (1)
Android (1)Android (1)
Android (1)
 
Android.ppt
Android.pptAndroid.ppt
Android.ppt
 
Android.ppt
Android.pptAndroid.ppt
Android.ppt
 
this is android development ppt.ppt
this is android development ppt.pptthis is android development ppt.ppt
this is android development ppt.ppt
 
Benefits of android phone.pptx
Benefits of android phone.pptxBenefits of android phone.pptx
Benefits of android phone.pptx
 
Android.ppt
Android.pptAndroid.ppt
Android.ppt
 
Android.ppt
Android.pptAndroid.ppt
Android.ppt
 
Android.ppt
Android.pptAndroid.ppt
Android.ppt
 
Power point activity 2
Power point activity 2Power point activity 2
Power point activity 2
 
Introduction to mobile technology
Introduction to mobile technologyIntroduction to mobile technology
Introduction to mobile technology
 
Introduction to Android | Android Tutorials | Android Blog - SearchforSolutio...
Introduction to Android | Android Tutorials | Android Blog - SearchforSolutio...Introduction to Android | Android Tutorials | Android Blog - SearchforSolutio...
Introduction to Android | Android Tutorials | Android Blog - SearchforSolutio...
 
Blending Creativity and Technology With Android App Development
Blending Creativity and Technology With Android App DevelopmentBlending Creativity and Technology With Android App Development
Blending Creativity and Technology With Android App Development
 
Power point activity 2
Power point activity 2Power point activity 2
Power point activity 2
 
Android...by raziel lucagbo
Android...by raziel lucagboAndroid...by raziel lucagbo
Android...by raziel lucagbo
 
Power point activity 2
Power point activity 2Power point activity 2
Power point activity 2
 
Mobile Application Development-Lecture 01 & 02.pdf
Mobile Application Development-Lecture 01 & 02.pdfMobile Application Development-Lecture 01 & 02.pdf
Mobile Application Development-Lecture 01 & 02.pdf
 
Ijetr021120
Ijetr021120Ijetr021120
Ijetr021120
 
Ijetr021120
Ijetr021120Ijetr021120
Ijetr021120
 

Último

KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineeringssuserb3a23b
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptrcbcrtm
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 

Último (20)

KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Odoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting ServiceOdoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting Service
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineering
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.ppt
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 

Android App

  • 1.
  • 2. Mobile: able to be moved from one place to another Mobile device is a general term for any handheld computer or smartphone. Tablets, e-readers, smartphones, PDAs, portable music players, smartwatches, and fitness trackers with smart capabilities are all mobile devices.
  • 3. A mobile phone, cellular phone, cell phone, handphone, sometimes shortened to simply mobile, cell or just phone, is a wireless handheld device(portable telephone) that can make and receive calls over a radio frequency link while the user is moving within a telephone service area. While the earliest generation of mobile phones could only make and receive calls, today’s mobile phones do a lot more, accommodating web browsers, games, cameras, video players and navigational systems.
  • 4. A handheld mobile radio telephone service was envisioned in the early stages of radio engineering. In 1917, Finnish inventor Eric Tigerstedt filed a patent for a "pocket-size folding telephone with a very thin carbon microphone". Early predecessors of cellular phones included analog radio communications from ships and trains. The advances in mobile telephony have been traced in successive "generations", starting with the early zeroth- generation (0G) services, such as Bell System's Mobile Telephone Service and its successor, the Improved Mobile Telephone Service. These 0G systems were not cellular, supported few simultaneous calls, and were very expensive.
  • 5.
  • 6. Like a computer operating system, a mobile operating system is the software platform for mobile devices on top of which other programs run. iOS An operating system from Apple, was originally developed for the iPhone. Later it was extended to support iPod Touch, iPad and Apple TV. Apple’s App Store contains more than 500,000 applications and have more than 25 billion downloads collectively. It holds the reputation of intelligent UI creator which is based on the concept of direct manipulation, using multi-touch gestures. Android It is a Linux based mobile operating system developed by the Open Handset Alliance led by Google. Android boasts large community of developers writing applications extending the functionality of the devices. It has 450,000 apps in its Android Market and download exceeds 10 billion count.
  • 7. BlackBerry OS It is developed by Research In Motion (RIM) for its line of smartphones. This operating system is known for its native support for corporate e- mail through MIDP allowing complete wireless activation and synchronization with Microsoft Exchange and Lotus Domino. Accordingly to one research approximately 45% of mobile developers were using the platform at the time of publication. It provides BlackBerry API classes for developers to write applications. Windows Phone A successor to Windows Mobile platform, Windows Phone, is a mobile operating system launched by Microsoft in late 2010. This mobile OS is targeted at consumer market. With this new operating system Microsoft offered a new user interface, Metro, integrating the operating system with third party and other Microsoft services, and controls the hardware on which it runs.
  • 8. Mobile Programming(application development) is the process to making software for smartphones and digital assistants, most commonly for Android and iOS. The software can be preinstalled on the device, downloaded from a mobile app store or accessed through a mobile web browser. The programming and markup languages used for this kind of software development include Java,Kotlin Swift, C# and HTML5.
  • 9. There are four major development approadches when building mobile applications.  Native Mobile Applications  Cross-Platform Native Mobile Applications  Hybrid Mobile Applications  Progressive Web Applications
  • 10. A native app is a platform-specific app that is capable of running only on a particular operating system. In other words, the business would have to develop apps differently for iOS and Android (i.e., to launch an app on both platforms, it will have to be coded twice). Building a native application is expensive (for obvious reasons). However, the app is often better in performance and offers a good user experience.
  • 11. A cross-platform app is coded once and is compatible to run on multiple platforms. In other words, there is a single, unified code that works for both Android and iOS apps. Cross-platform apps are cheaper to build owing to its platform independent attribute.
  • 12. A hybrid app is a blend of a native mobile app and a web app. In technical terms, a web application put into a native shell is a hybrid app. These apps are built in a native container but, when downloaded, they showcase content similar to that of a web app. These apps are easier and faster to develop but might lead to performance issues.
  • 13. A progressive web app (PWA) is a web application that offers a native app-like user experience. The best part is that a PWA runs on the web, which implies that the user does not need to install a separate app for it. The upshot of PWAs are that they consume less data, perform better, and increase engagement rates.
  • 14. There are two interlinked core components of a mobile application: 1) the mobile application "Front-End" that resides on the mobile device, and 2) the services "Back- End" that supports the mobile front-end.
  • 15.
  • 16. In the early days of the modern smartphone applications era, mobile applications went through a similar evolution as first websites. At first, the applications and sites where wholly contained within themselves and acted as little more than static advertisements for the brand, company, product, or service. However, as connectivity and network capabilities improved, the applications became increasingly connected to sources of data and information that lived outside of the app itself, and the apps became increasingly dynamic as they were able to update their UI and content with data received over the network from queries to data sources. As a result, the mobile front-end applications increasingly rely on and integrated with back-end services which provide data to be consumed through the mobile front-end. Such data can include, for example, product information for e-commerce apps or flight info for travel and reservation apps. For a mobile game, the data may include new levels or challenges and scores or avatars from other players.
  • 17. Android is a mobile operating system based on a modified version of the Linux kernel and other open source software, designed primarily for touchscreen mobile devices such as smartphones and tablets. Android is developed by a consortium of developers known as the Open Handset Alliance and commercially sponsored by Google. It was unveiled in November 2007, with the first commercial Android device, the HTC Dream, being launched in September 2008. It is free and open-source software; its source code is known as Android Open Source Project (AOSP), which is primarily licensed under the Apache License. However most Android devices ship with additional proprietary software pre-installed,[14] most notably Google Mobile Services (GMS) which includes core apps such as Google Chrome, the digital distribution platform Google Play, and associated Google Play Services development platform.
  • 18. The history and versions of android are interesting to know. The code names of android ranges from A to J currently, such as Aestro, Blender, Cupcake, Donut, Eclair, Froyo, Gingerbread, Honeycomb, Ice Cream Sandwitch, Jelly Bean, KitKat and Lollipop. 1) Initially, Andy Rubin founded Android Incorporation in Palo Alto, California, United States in October, 2003. 2) In 17th August 2005, Google acquired android Incorporation. Since then, it is in the subsidiary of Google Incorporation. 3) The key employees of Android Incorporation are Andy Rubin, Rich Miner, Chris White and Nick Sears. 4) Originally intended for camera but shifted to smart phones later because of low market for camera only. 5) Android is the nick name of Andy Rubin given by coworkers because of his love to robots. 6) In 2007, Google announces the development of android OS. 7) In 2008, HTC launched the first android mobile.
  • 19.
  • 20. 1) Linux kernel It is the heart of android architecture that exists at the root of android architecture. Linux kernel is responsible for device drivers, power management, memory management, device management and resource access. 2) Native Libraries On the top of linux kernel, their are Native libraries such as WebKit, OpenGL, FreeType, SQLite, Media, C runtime library (libc) etc. The WebKit library is responsible for browser support, SQLite is for database, FreeType for font support, Media for playing and recording audio and video formats. 3) Android Runtime In android runtime, there are core libraries and DVM (Dalvik Virtual Machine) which is responsible to run android application. DVM is like JVM but it is optimized for mobile devices. It consumes less memory and provides fast performance.
  • 21. 4) Android Framework On the top of Native libraries and android runtime, there is android framework. Android framework includes Android API's such as UI (User Interface), telephony, resources, locations, Content Providers (data) and package managers. It provides a lot of classes and interfaces for android application development. 5) Applications On the top of android framework, there are applications. All applications such as home, contact, settings, games, browsers are using android framework that uses android runtime and libraries. Android runtime and native libraries are using linux kernal.
  • 22.
  • 23. A view hierarchy defines the relationships of views in a window to each other. You can think of a view hierarchy as an inverted tree structure with the window being the top node of the tree. Under it come views structurally specified by parent-child relationships. From a visual perspective, the essential fact of a view hierarchy is enclosure: one view contains one or more other views, and the window contains them all. The view hierarchy is also the governing concept behind view composition: You construct compound views by adding subviews to a superview. Finally, the view hierarchy is a critical factor in the multiple coordinate systems found in a window.
  • 24. A layout defines the structure for a user interface in your app, such as in an activity. All elements in the layout are built using a hierarchy of View and ViewGroup objects. A View usually draws something the user can see and interact with. Whereas a ViewGroup is an invisible container that defines the layout structure for View and other ViewGroup objects, as shown in figure
  • 25. The View objects are usually called "widgets" and can be one of many subclasses, such as Button or TextView. The ViewGroup objects are usually called "layouts" can be one of many types that provide a different layout structure, such as LinearLayout or ConstraintLayout . You can declare a layout in two ways: Declare UI elements in XML. Android provides a straightforward XML vocabulary that corresponds to the View classes and subclasses, such as those for widgets and layouts. You can also use Android Studio's Layout Editor to build your XML layout using a drag-and-drop interface. Instantiate layout elements at runtime. Your app can create View and ViewGroup objects (and manipulate their properties) programmatically.
  • 26. Linear Layout LinearLayout is a view group that aligns all children in a single direction, vertically or horizontally. Relative Layout RelativeLayout is a view group that displays child views in relative positions. Table Layout TableLayout is a view that groups views into rows and columns. Absolute Layout AbsoluteLayout enables you to specify the exact location of its children. Frame Layout The FrameLayout is a placeholder on screen that you can use to display a single view. Scroll Layout ListView is a view group that displays a list of scrollable items. Grid View GridView is a ViewGroup that displays items in a two-dimensional, scrollable grid.
  • 27. We use this layout to place the elements in a linear manner. A Linear manner means one element per line. This layout creates various kinds of forms on Android. In this, arrangement of the elements is in a top to bottom manner. This can have two orientations: a. Vertical Orientation – It is shown above where the widgets such as TextViews, and all in a vertical manner. b. Horizontal Orientation – It is shown above where the widgets such as TextViews, and all in a horizontal manner.
  • 28.
  • 29. A LinearLayout respects margins between children and the gravity (right, center, or left alignment) of each child. Most important attribute of the LinearLayout is orientation android:orientation="vertical"or android:orientation="horizontal" <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="16dp" android:paddingRight="16dp" android:orientation="vertical" > .... ... </LinearLayout> Dp: density independent pixel
  • 30. The basic building block for user interface is a View object that is created from the View class and occupies a rectangular area on the screen. Views are the base class for UI components like TextView, Button, EditText etc. The ViewGroup is a subclass of View. One or more Views can be grouped together into a ViewGroup. A ViewGroup provides the android layout in which we can order the appearance and sequence of views. Examples of ViewGroup are LinearLayout, FrameLayout, RelativeLayout etc.
  • 31. Android provides the following ViewGroups or layouts: LinearLayout : is a ViewGroup that aligns all children in a single direction, vertically or horizontally RelativeLayout : is a ViewGroup that displays child views in relative positions AbsoluteLayout : allows us to specify the exact location of the child views and widgets TableLayout : is a view that groups its child views into rows and columns FrameLayout : is a placeholder on screen that is used to display a single view ScrollView : is a special type of FrameLayout in that it allows users to scroll through a list of views that occupy more space than the physical display. The ScrollView can contain only one child view or ViewGroup, which normally is a LinearLayout ListView : is a view group that displays a list of scrollable item GridView : is a ViewGroup that displays items in two-dimensional scrolling grid. The items in the grid come from the ListAdapter associated with this view
  • 32. android:id : This is the ID which uniquely identifies the view android:layout_width : This is the width of the layout android:layout_height : This is the height of the layout android:layout_margin : This is the extra space outside of the view. For example if you give android:marginLeft=20dp, then the view will be arranged after 20dp from left android:layout_padding : This is similar to android:layout_margin except that it specifies the extra space inside the view android:layout_gravity : This specifies how child Views are positioned(left,right, center, center-horizontal) android:layout_weight : This specifies how much of the extra space in the layout should be allocated to the view android:layout_x : This specifies the x-coordinate of the layout android:layout_y : This specifies the y-coordinate of the layout android:layout_width=wrap_content tells the view to size itself to the dimensions required by its content. android:layout_width=match_parent tells the view to become as big as its parent view.
  • 33. Android LinearLayout organizes elements along a single line. We can specify whether that line is vertical or horizontal using android:orientation. The orientation is horizontal by default. A vertical LinearLayout will only have one child per row (so it is a column of single elements), and a horizontal LinearLayout will only have one single row of elements on the screen. android:layout_weight attribute depicts the importance of the element. An element with larger weight occupies more screen space.
  • 34. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <Button android:id="@+id/btn1" android:layout_width="270dp" android:layout_height="wrap_content" android:text="Button1"/> <Button android:id="@+id/btn2" android:layout_width="270dp" android:layout_height="wrap_content" android:text="Button2"/> <Button android:id="@+id/btn3" android:layout_width="270dp" android:layout_height="wrap_content" android:text="Button3"/> </LinearLayout>
  • 35. RelativeLayout is a view group that displays child views in relative positions. The position of each view can be specified as relative to sibling elements (such as to the left-of or below another view) or in positions relative to the parent RelativeLayout area (such as aligned to the bottom, left of center). For example in a class, if a Student A is sitting on a chair and the teacher of the class asks Student B to sit to the right of the Student A. Student B will know where he/she has to sit. A RelativeLayout is a very powerful utility for designing a user interface because it can eliminate nested view groups and keep your layout hierarchy flat, which improves performance. If you find yourself using several nested LinearLayout groups, you may be able to replace them with a single RelativeLayout.
  • 36.
  • 37. Center relative to Parent View When you want to place your Views in the center relative to the parent, you can use the following 3 attributes: android:layout_centerHorizontal="true" This places the view horizontally in the center of the parent. As our parent view covers the whole screen of mobile therefore the view gets placed in the middle of the mobile screen horizontally. (See the yellow view in the above figure) android:layout_centerVertical="true" This places the view vertically in the center of the parent. Since the parent view covers the whole screen of mobile hence the view gets placed in the middle of the mobile screen vertically. (See the blue view in the above figure) android:layout_centerInParent="true" This attribute will place the view in the center of the parent. Since the parent in our example covers the whole screen of mobile, so the view gets placed in the middle of the mobile screen, both horizontally and vertically.
  • 38. Align by the parent view android:layout_alignParentTop="true" If you write this attribute for a View, then that view will stick to the top of its parent. Since the parent covers the whole screen of mobile therefore, the view will appear sticking to the top-left of the mobile screen. android:layout_alignParentBottom="true" If you write this attribute for a View, then that view will stick to the bottom of its parent. Since the our parent covers the whole screen of mobile therefore, the view will appear sticking to the bottom of the mobile screen. android:layout_alignParentLeft="true" If you write this attribute for a View, then that view will stick to the left of its parent. Since the parent in our example covers the whole screen of mobile therefore, the view will appear sticking to the left of the mobile screen. android:layout_alignParentRight="true" If you write this attribute for a View, then that view will stick to the right of its parent. Note: You can always use more than one of these attributes. Suppose you use android:layout_alignParentLeft="true" and android:layout_alignParentBottom="true", then the view will stick to the bottom-left corner of the screen
  • 39. Align new View relative to existing sibling View If you want to align the new view relative to any existing view, then you can use the following attributes. Relative Layout in Android android:layout_alignTop="@id/a" This aligns the top margin of the new view with the top margin of the view having id as a. android:layout_alignBottom="@id/a" This aligns the bottom margin of the new view with the bottom margin of the view having id as a. android:layout_alignLeft="@id/a" This aligns the left margin of the new view with the left margin of the view having id as a. android:layout_alignRight="@id/a" This aligns the right margin of the new view with the right margin of the view having id as a. android:layout_alignBaseLine="@id/a" This aligns the text1 of the new view with the text2 of the view having id as a.
  • 40. <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#FFEB3B" tools:context="com.example.myapplication.RelativeActivity"> <TextView android:id="@+id/textView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:textStyle="bold" android:textAllCaps="true" android:textSize="17sp" android:text="Two Button will use me as a reference" /> <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Aligned to thensecond button" android:layout_below="@+id/textView" android:layout_alignLeft="@+id/textView" android:layout_margin="5dp" android:layout_alignStart="@+id/textView" /> <Button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Aligned to thenfirst button" android:layout_toRightOf="@id/button" android:layout_alignTop="@id/button" android:layout_below="@+id/textView" android:layout_marginRight="21dp" android:layout_marginEnd="21dp" /> <TextView android:id="@+id/textView5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/button" android:layout_alignStart="@+id/button" android:layout_below="@+id/button" android:layout_marginTop="70dp" android:textStyle="bold|italic" android:textSize="20sp" android:textColor="#25c" android:text="I want to align by basenline with you" /> <TextView android:id="@+id/textView6" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/textView5" android:layout_alignTop="@+id/textView5" android:layout_margin="10dp" android:textSize="20sp" android:textStyle="bold|italic" android:textColor="#25c" android:layout_marginTop="70dp" android:layout_alignBaseline="@id/textView5" android:text="Okay,let me use the attribute" /> <TextView android:id="@+id/textView4"
  • 41. A TableLayout is a ViewGroup that arranges its children i.e Views and other Layouts in a table form with rows and columns. To define a row, you can use <TableRow> tag inside this layout. There is no need to mention number of columns in a TableLayout because Android automatically adds columns as per the number of views and other layouts added in a table row.
  • 42. <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="16dp" android:background="#FFFF00"> <!-- first row --> <TableRow android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:background="@color/colorAccent"> <TextView android:id="@+id/textView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="NAME" android:textAppearance="?android:attr/textAppearanceMedium"/> <EditText android:id="@+id/edtName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="10" android:hint="Enter you name" android:inputType="textPersonName"/> </TableRow> <!-- second row --> <TableRow android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:background="#0091EA"> <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Password" android:textAllCaps="true" android:textAppearance="?android:attr/textAppearanceMedium"/> <EditText android:id="@+id/edtPwd" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="10" android:hint="Enter your Password" android:inputType="textPassword"/>
  • 43.
  • 44. An Absolute Layout allows you to specify the exact location .i.e., X and Y coordinates of its children with respect to the origin at the top left corner of the layout. The absolute layout is less flexible and harder to maintain for varying sizes of screens. Some of the important Absolute Layout attributes are the following: android:id: It uniquely specifies the absolute layout android:layout_x: It specifies X-Coordinate of the Views (Possible values of this is in density-pixel or pixel) android:layout_y: It specifies Y-Coordinate of the Views (Possible values of this is in dp or px)
  • 45. <?xml version="1.0" encoding="utf-8"?> <AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" tools:context=".MainActivity"> <!--Setting up TextViews--> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_x="100px" android:layout_y="300px" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_x="120px" android:layout_y="350px" /> </AbsoluteLayout>
  • 46. Constraint Layout is a ViewGroup (i.e. a view that holds other views) which allows you to create large and complex layouts with a flat view hierarchy, and also allows you to position and size widgets in a very flexible way. It was created to help reduce the nesting of views and also improve the performance of layout files. Constraint Layout Example In Android Studio ConstraintLayout is very similar to RelativeLayout in such a way because, views are laid out according to relationships between sibling views and the parent layout yet it’s a lot more flexible and works better with the Layout Editor of the Android Studio’s. It was released at Google I/O 2016. Since it came into existence
  • 47. <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="https://schemas.android.com/apk/res/android" xmlns:app="https://schemas.android.com/apk/res-auto" xmlns:tools="https://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:text="TextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/textView" android:layout_marginStart="16dp" app:layout_constraintLeft_toLeftOf="parent" android:layout_marginLeft="16dp" android:layout_marginEnd="16dp" app:layout_constraintRight_toRightOf="parent" android:layout_marginRight="16dp" android:layout_marginTop="16dp" app:layout_constraintTop_toTopOf="parent" /> <TextView android:text="TextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/textView2" app:layout_constraintBaseline_toBaselineOf="@+id/textView" android:layout_marginStart="16dp" app:layout_constraintLeft_toLeftOf="parent" android:layout_marginLeft="16dp" app:layout_constraintRight_toLeftOf="@+id/textView" android:layout_marginEnd="8dp" android:layout_marginRight="8dp" /> </android.support.constraint.ConstraintLayout>
  • 48. An activity is referred to as one screen in an application. It is very similar to a single window of any desktop application. An Android app consists of one or more screens or activities. Each activity goes through various stages or a lifecycle and is managed by activity stacks. So when a new activity starts, the previous one always remains below it.
  • 49. If an activity is in the foreground of the screen i.e at the top of the stack, then it is said to be active or running. This is usually the activity that the user is currently interacting with. If an activity has lost focus and a non-full-sized or transparent activity has focused on top of your activity. In such a case either another activity has a higher position in multi-window mode or the activity itself is not focusable in the current window mode. Such activity is completely alive. If an activity is completely hidden by another activity, it is stopped or hidden. It still retains all the information, and as its window is hidden thus it will often be killed by the system when memory is needed elsewhere. The system can destroy the activity from memory by either asking it to finish or simply killing its process. When it is displayed again to the user, it must be completely restarted and restored to its previous state.
  • 50.
  • 51. It is called when the activity is first created. This is where all the static work is done like creating views, binding data to lists, etc. This method also provides a Bundle containing its previous frozen state, if there was one. @override protected void onCreate(Bundle savedInstanceState) { .... Toast toast = Toast.makeText(getApplicationContext(), "onCreate Called", Toast.LENGTH_LONG).show(); }
  • 52. It is invoked when the activity is visible to the user. It is followed by onResume() if the activity is invoked from the background. It is also invoked after onCreate() when the activity is first started. @override protected void onStart() { // It will show a message on the screen // then onStart is invoked Toast toast = Toast.makeText(getApplicationContext(), "onStart Called", Toast.LENGTH_LONG).show(); }
  • 53. It is invoked after the activity has been stopped and prior to its starting stage and thus is always followed by onStart() when any activity is revived from background to on-screen. @override protected void onRestart() { // It will show a message on the screen // then onRestart is invoked Toast toast = Toast.makeText(getApplicationContext(), "onRestart Called", Toast.LENGTH_LONG).show(); }
  • 54. It is invoked when the activity starts interacting with the user. At this point, the activity is at the top of the activity stack, with a user interacting with it. Always followed by onPause() when the activity goes into the background or is closed by the user. protected void onResume() { // It will show a message on the screen // then onResume is invoked Toast toast = Toast.makeText(getApplicationContext(), "onResume Called", Toast.LENGTH_LONG).show(); }
  • 55. It is invoked when an activity is going into the background but has not yet been killed. It is a counterpart to onResume(). When an activity is launched in front of another activity, this callback will be invoked on the top activity (currently on screen). The activity, under the active activity, will not be created until the active activity’s onPause() returns, so it is recommended that heavy processing should not be done in this part. protected void onPause() { // It will show a message on the screen // then onPause is invoked Toast toast = Toast.makeText(getApplicationContext(), "onPause Called", Toast.LENGTH_LONG).show(); }
  • 56. @Override protected void onStop() { super.onStop(); // The activity is no longer visible (it is now "stopped") }  This method is called when the Activity is no longer visible in the app.  It can happen, for example, when another Activity has been loaded and is taking the full screen of the device.  When this method is called, the Activity is said to be in a stopped state.  In this state, the system either calls the onRestart() to bring back interactivity with Activity. Or it calls the onDestroy() method to destroy the Activity.
  • 57. The final call received before the activity is destroyed. This can happen either because the activity is finishing (when finish() is invoked) or because the system is temporarily destroying this instance of the activity to save space. To distinguish between these scenarios, check it with isFinishing() method. protected void onDestroy() { // It will show a message on the screen // then onDestroy is invoked Toast toast = Toast.makeText(getApplicationContext(), "onDestroy Called", Toast.LENGTH_LONG).show(); }