Unit One For Mobile Programming
Unit One For Mobile Programming
Unit one
Introduction to Mobile programming
Well Come to class of Mobile
programming
Unit one
Introduction to Android
Out comes
What is android?
Features of android?
Android OS Architecture.
Android development environment
What is android?
Android is an open-source, Linux-based operating
system for mobile devices such as smartphones and
tablet computers.
Android was developed by the Open Handset
Alliance, led by Google, and other companies.
Why Android ?
Features of android
Beautiful UI Web browser
Connectivity Multi-touch
Storage Multi-tasking
Media support Multi-Language
Messaging GCM
Features of android
Beautiful UI:- Android OS basic screen provides a
beautiful and intuitive user interface.
Connectivity:-support GSM/EDGE, IDEN, CDMA, EV-DO, UMTS, Bluetooth,
Wi-Fi, LTE, NFC and WiMAX.
Multi-touch:- Android has native support for multi-touch which was initially made
available in handsets such as the HTC Hero.
Multi-tasking:- User can jump from one task to another and same time various
application can run simultaneously.
Resizable widgets:- Widgets are resizable, so users can expand them to show more
content or shrink them to save space.
Multi-Language:- Supports single direction and bi-directional text.
GCM:- Google Cloud Messaging (GCM) is a service that lets
developers send short message data to their users on Android devices,
without needing a proprietary sync solution
What is API level?
API Level is an integer value that uniquely identifies the
framework API revision offered by a version of the
Android platform.
Examples Lolipop(21), Kitkit(19),
Jelly_bean(16) etc
Android OS Architecture
is a stack of software components which is roughly divided into five sections
and four main layers.
Android OS Architecture
is a stack of software components which is roughly divided into five sections and
four main layers.
Mainly
1. Linux kernel
At the bottom of the layers is Linux
It provides basic system functionality like process management, memory
management, device management like camera, keypad, display etc.
It handles all the things that Linux is really good at, such as networking and a vast
array of device drivers.
Android OS Architecture
is a stack of software components which is roughly divided into five sections and
four main layers.
Mainly
2. Libraries
On top of Linux kernel
There is a set of libraries including
Open-source Web browser engine WebKit,
Well known library libc,
SQLite database which is a useful repository for storage and
Sharing of application data,
Libraries to play and record audio and video,
SSL libraries responsible for Internet security etc.
Android OS Architecture
is a stack of software components which is roughly divided into five sections and four main layers.
2. Libraries
A summary of some key core Android libraries available to the Android developer is as follows −
android.app − Provides access to the application model and is the cornerstone of all Android applications.
android.content − Facilitates content access, publishing and messaging between applications and
application components.
android.database − Used to access data published by content providers and includes SQLite database
management classes.
android.opengl − A Java interface to the OpenGL ES 3D graphics rendering API.
android.os − Provides applications with access to standard operating system services including messages,
system services and inter-process communication.
android.text − Used to render and manipulate text on a device display.
android.view − The fundamental building blocks of application user interfaces.
android.widget − A rich collection of pre-built user interface components such as buttons, labels, list
views, layout managers, radio buttons etc.
android.webkit − A set of classes intended to allow web-browsing capabilities to be built into
applications.
Android OS Architecture
is a stack of software components which is roughly divided into five sections and four
main layers.
Mainly
3. Android Runtime
It is the third section of the architecture and available on the second layer from the
bottom.
It provides a set of core libraries- enable a developer to use java language.
It provides a key component called Dalvik Virtual Machine which is a kind of Java
Virtual Machine specially designed and optimized for Android.
NB:- The Dalvik VM enables every Android application to run in its own
process.
- The Dalvik VM makes use of Linux core features like memory
management and multithreading, which is intrinsic in the Java language.
Android OS Architecture
is a stack of software components which is roughly divided into five sections
and four main layers.
4. Applications Framework
It provides many higher-level services to applications in the form of Java
classes.
4. Applications Framework
The Android framework includes the following key services −
Activity Manager − Controls all aspects of the application lifecycle and activity stack.
Content Providers − Allows applications to publish and share data with other applications.
Resource Manager − Provides access to non-code embedded resources such as strings, color settings and
user interface layouts.
Notifications Manager − Allows applications to display alerts and notifications to the user.
View System − An extensible set of views used to create application user interfaces.
Android OS Architecture
is a stack of software components which is roughly divided into five sections
and four main layers.
Mainly
5 Applications
All the Android application are at the top layer of architecture.
Application to be installed is written on this layer only.
Examples are Contacts Books, Browser, Games, etc.
Android development Environment
package com.example.HelloWorld;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
Android Application code for Hello world example
Manifest File:-is a root of app because
whatever component of application is declared in it.
works as an interface between Android OS and your application.
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.HelloWorld">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</manifest>
Android Application code for Hello world example
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
android:textSize="50dp"
android:textAllCaps="true"
android:textColor="@color/purple_500"
android:textAlignment="gravity"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
Set up AVD