Vous êtes sur la page 1sur 17

Android

 DVM -> dalvik virtual machine


 Though a Linux, not a Linux standard
 Open source Linux kernel
 Android is a stack
 Applications are integrated
 Cannot be viewed as a layer
 Reference design: suitable for all mobile devices [cross compatibility].
 Works on phones, tablets, etc.
 Near field communications [NFC]

Definition:
Android is a mobile platform which includes the OD [Linux kernel], UI,
and key applications.

1. Independent components

Android is an ecosystem because it is dependent on the three major


components:
o OS
o UI
o Key applications

2. Dependent components – integrating other applications into


android.

o Compatibility
o Definition
o Documenting
o Compatibility test suite
o Linux kernel – means only for lower level interface

Lower level interface


 Helps improve the hardware device.
 Libraries divided in ways like database, graphics, etc.
 Includes SQLite library
 SQLite is a database within android
 SQLite is easy to use
 Web Kit – database on webservers
 OpenGL – Open Graphic Language Library
 Media Manager

User Interface (UI)


 Android Open Source Project

Evolution of device architecture

GSM EDGE LTE

Software Development Kit (SDK)


1. API – Application Programming Interface
2. Intent
3. Content provider - Database
4. Activity – Programming screen
5. Multimedia
6. Communication between devices
o Wi-Fi
o Bluetooth – Near Field Communication (NFC)
o Portable Hotspot
o Data transfer – Wi-Fi, Bluetooth, NFC.
7. Widgets
8. Multimedia library
9. C2DM – cloud to device messaging.

 T-Mobile G1 was the 1st mobile with android Operating System (2008).

Topics for 28/11/18


SDK features
Applications
Advantages and disadvantages of mobile technology
Advantages and disadvantages of android
Features of SDK 12 features)
Meaning of widgets.
Meaning of intent
Meaning of activity and content provider.
Evolution of mobile technologies.
Android SDK Features

1. GSM and EDGE and LTE networks for telephony or data transfer, enabling
users to make or receive calls SMS messages and retrieve data across mobile
networks.
2. Comprehensive APIs for location-based services such as GPS and network-
based location detection.
3. Full support for applications that integrate map controls as part of their user
interfaces.
4. Wi-Fi hardware access and Peer-To-Peer connections.
5. Full multimedia hardware control including playback and recording with
camera and microphone.
6. Media libraries for playing and recording a variety of audio/video or still
image formats.
7. APIs for using sensor hardware including compasses and other devices.
8. Libraries for using Bluetooth and NFC hardware for peer to peer data
transfer.
9. IPC message passing.
10.Shared data stores and APIs for contacts, social networking, calendar
and multimedia.
11. Background services(notifications), applications and processes.
12. Home screen widgets and live wallpapers.
13. The ability to integrate applications, search results into the system
searches.
14. An integrated open source HTML file Web kit-based browser.
15. Mobile optimized, hardware accelerated graphics including a path based
two-dimensional graphics library and support for 3-D graphics (open GL).
16. Localization thought a dynamic resources framework.
17. An application framework that encourages the reuse of application.
18. Components and the replacements of native application (calculator, alarm,
calendar and email client).

Q. Write 10 points on:

1. Android
2. Blackberry
3. IOS
 Cloud storage facility
 64-bit architecture
 3rd party applications support
 Optimized application management and hardware
 No support for flash player
 Based on Swift and objective C
 Unix based security system
 Designed on C#
 No widgets, only notification bar

4. Samsung
5. Vodafone
6. Nokia

// Write difference between mobile hardware and mobile applications //

December 3, 2018

Linux (Lowest layer)


1. hardware drivers that include
(i) USB
(ii) Display
(iii) Bluetooth, etc.

2. Power management
3. Process management
4. Memory management

Libraries(Middleware)
 Divided into two parts
1. Android runtime
(i) Includes android libraries
(ii) Dalvik virtual machine(DVM)

2. Other libraries such as graphics such as Open-GL


(i) Medium
(ii) SQLite
(iii) SSL(secure socket layer)
(iv) Web-kit
(v) Surface manager
(vi) Other libraries include C,C++ (Library C)
Application framework
1. Telephony
2. Content provider
3. Location based service
4. Window manager
5. Notification
6. Activity manager
7. Views
8. Package manager
9. Resource manager

Application Layer (Uppermost layer)


1. Native applications
2. 3rd Party developer

December 5, 2018
ANDROID VERSIONS

1. Android API 1.0 Alpha, Beta (2008)


2. Android 1.5/1.6 Cupcake (2009 April)
3. Android 1.6 Doughnut (2009 September)
4. Android 2.0/2.1 Eclairs (2009 October)
5. Android 2.2/2.2.3 Froyo (2010 May)
6. Android 2.3/2.3.7 Gingerbread(2010 December)
7. Android 3.0/3.2 Honeycomb (2011 February)
8. Android 4.0/4.0.4 Ice Cream Sandwich(2011 October)
9. Android 4.1 Jelly Bean(July 2012)
10.Android 4.4 KitKat(October 2015)
11.Android 5.0 Lollipop(November 2014)
12.Android 6.0 Marshmallow(October 2015)
13.Android 7.0/7.1.1 Nougat
14.Android 8.0/8.1 Oreo
15.Android 9.0 Pie (API 28 – Current)
16.Android 10.0 Quick Bread
17.Android 11.0 Rocky Road
18.Android 12.0 Strawberry
19.Android 13.0 Udc(I don’t know, didn’t hear :P)
20.Android 14.0 Vanilla
Linux Kernel
 Memory management
 Process management
 Network management
(No sub versions)
 It is very secure. Linux kernel provides the security for android.

Drivers
1. Display driver
2. Camera driver
3. Flash driver
4. Binder
5. Power
6. Audio
7. WIFI driver
8. Keypad driver

Native Libraries Android Run Time


Surface manager Core (Java)Library
OpenGL Dalvik Virtual machine
SGL (all devices are supported)
Media Framework
Free type
WebKit
SSL
Lib C
SQLite

Important
 Differences between JVM and DVM.

Process of using an app: JVM  (query)  APK  (installed into the device)
Application Framework –
1. Activity manager
2. Window
3. Content provider
4. View manager package manger
5. Telephony manager
6. Resource manager
7. Location manager
8. Notification

Application Framework

Linux kernel
December 6, 2018

Major Points:
 Minimum space required - 1.5 Mb to 100 Mb for the Linux kernel space
 Two advantages of Linux:
1. Low cost
2. Android runs on Linux kernel.

It provides:
1. Hardware abstraction layer
2. Memory management
3. Process management
4. Network

 Users never see Linux as a sub system.


 It has a shell command open Linux shell
 The main aim of android is not just a single device but the vision is mobile
platform which runs on many different devices.
 High level of security is provided because of which native applications are
possible.

Middleware/libraries

They are divided into 2 groups:

1. Android run time


(Consists of java libraries and DVM)

 Java libraries:
(a) Includes a set of java files known as android java which is a
version of JAVA SE(Standard Edition)
JAVA SE consists of AWT(Application Window Tool)/Swing) and
also Android API.

 Android studio involves converting the source code into Dalvik


Byte Code that is runnable on Dalvik Executable with a file
extension .dex

 DVM it is android implementation of JVM


 Dalvik IS optimized for mobile devices.
 It provides battery consumption and CPU capabilities.
Differences:
Java Dalvik
Register based VM Stack based VM
Extension . java Extension : .dex
Less efficient and big More efficient and compact
Based for intel-based computers Based for all types of devices

2. Native Libraries
Piece of program or a code of a project which Is developed using open
source can be included in mobile applications.
1. SQLite - database
2. WebKit – browser (for fast HTML rendering)
3. LibC – C++ and C
4. OpenGL for graphics
5. Media CODECS(It offers supports for major audio or video CODECS)
6. BioNic
o Open source project
o It consists of small friendly libraries optimized for android
using the C and C++ language.
o It has the advantage of its speed and compact.

Open source

Application Framework
 It consists of rich set of system services wrapped in an java API.
 This ecosystem helps the developers to easily write apps for the android.
 The other services within application framework are:
1. Location
2. Web
3. Telephony
4. WIFI
5. Bluetooth
6. Notifications
7. Media
8. Camera, etc.

Application includes both native application and mobile app developers.


These applications are supported by apk which include Dalvik executable
with resources.
Android Markets:

Google android market


Amazon android market

Steps to start a simple project:

1. After the installation of android studio, double click on the icon.


2. Click on “ start a new android project”.
3. Give an application name. Selected the targeted device.
4. On the screen, add an activity to mobile
5. This window consists of three kinds of information:
a) Project structure
b) Layout
c) Design screen
Files and folders for a project:

1. Java:
 Consists of .java source files for the project
 By default, it includes a MainActivity.java
 Source file having an activity class that runs when the app is
launched using the app icon.

2. Drawable: (Subfolder of Resource)


 This is the directory for drawable objects that are designed
for high density screens.

3. Layout
 This is the directory for files that define the application’s user
interface

4. Values
 This Is the directory for various xml files that contain a
collection of resource which can contain string and color
specifications.

5. AndroidManifest.xml
 This is the manifest file which describes the fundamental
characteristics of the application and defines each of its
components.

6. Build Gradle
 This is an auto generated file which contains:
o Compile SDK version
o BuildTool version
o API
o Target SDK version
o View code
o View name
Importance of layout

The most important properties of layout is:

1. Wrapped content
2. Match parent
3. ID ( assigns a value of the view which helps in runtime for java also
known as reference point) [important]
4. Text size (pixel – for only one particular device)
Has three different units:
a) Pixel (px)
b) Dp (device independent for low density text)
c) Sp (scale independent)

Important properties for relative layout:


 All the layouts have the common property such as width,
height.
 The very first layout which is used in the xml file will have the
description of the activity or name.

Example:
com.firstapp.MainActivity
Other types of layout:
 Linear
a) Horizontal
b) Vertical
This can be changed in the property called orientation.
The layouts can also be nested

 Frame
o Frame layout is designed for a screen where the image
or background can be added on the screen in which the
views can be on the background or image.
o The most important property for frame layout is source
(src)
o Sources are taken from mipmap/filename.
o This property is similar to card layout which is used in
java swing.
 Grid

Activity Life Cycle

Introduction

 The activity life cycle includes different methods during active state and
minimized state

 Active state which is known as start activity calls three methods
OnCreate(); OnStart(); OnResume();

These methods will be called one-by-one and there is no change in


order.

 The next state is minimized stage. During this state two methods are
called in an order :
OnPause()  OnStop();

 On closing an activity, the order of method is


OnPause()  OnStop()  OnDestroy();

 When the minimized activity is resumed, it can be started again only by


methods OnPause(); and OnResume();

 After long time, if the activity is not active or open, then the two
methods OnStop(); and OnDestroy(); will shut down the activity.
 Going back to main screen always call OnStart();

 Directly from OnStop(); it can only go to OnCreate();

LOGCAT
It is used to get the status or a detailed description of the activity
Log.d() – method for getting info in logcat
ACTIVITY LIFECYCLE

Activity launcher

onCreate()

onStart()

onResume()

Another Activity

onPause()

Activity layout not visibile

onStop()

Activity is finishing
Destroy()

Activity
Toast

s
Checkbox
3. From widget . choose radio-button tools and drag and drop inside the radio group
Assign an ID for these radio buttons and radio group. Add a button outside the
radio group.
4. In the property of radio group, change the layout width.

JAVA File.
1. Ensure that the relevant packages for radio buttons and radio groups are included.

Syntax :
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.RadioButton;
import android.widget.RadioGroup;

Declaration:
public class MainActivity extends AppCompatActivity {
private static RadioGroup radioG;
private static RadioButton btn;

Vous aimerez peut-être aussi