Download Introdcution

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Mobile Applications
(Android Programming)
Semester II
2016 - 2017
Dr. Saman Mirza Abdullah
Course Information
• Have 14 classes.
o 12 classes, each 2 hours Theoretical and 2 hours practical.
o One week will be midterm exam.
o One class for course review
• Exams and assessments (collecting marks):
o
o
o
o
o
o
Attendance
Quizzes
Assignments
Lab activities
One mid term exam
One final Exam
= 5%
= 5%
= 10%
= 10%
= 30%
= 40%
• Text book
o Annuzzi, J., L. Darcey, and S. Conder, Introduction to Android Application
Development: Android Essentials. 2014: Addison Wesley Professional.
o Trish Cornez, Richard Cornez, 2015 , Android programming concept: 2015,.
Mobile Application - Ishik
2
Course Aim
• The aim of the course is to introduce CE students to:
o
o
o
o
o
The fundamental concepts of Mobile Application.
Android Programming,
Parts of the Android based applications,
Learning Android Studio software. (Downloading and installing)
Building Android based application from scratch until uploading to
Google Play Store.
Mobile Application - Ishik
3
Class Objectives
• Introduction to Mobile and Android application.
• What is Android?
• Understand Android based Application.
• Explain Android Architecture and fundamental?
• Showing the process of creating .apk file.
Mobile Application - Ishik
4
History of Mobile and its
Application
• How was the live before mobile?
o Phone was just phone, with a fixed land line.
o Run for the phone or pulling it out from pocket.
o Lost a friend, forgetting something from home, emergency calls for an
accidents…..
• The are not called smartphone for no reasons.
o They can solve many problems.
o Daily, we relay on them for everything of our live.
• It has a lot of types of applications. Developers
should be aware about applications so that they
can be
o More seamless and powerful applications.
Mobile Application - Ishik
5
History of Mobile and its
Application (Cont.)
• Mobile developers faced many roadblocks:
o Better applications.
o Unique application, but competing other application
o Hybrid application, but can incorporate many tasks (calling and
messaging)
o User friendly.
• At the beginning, all these were not realistic.
Mobile Application - Ishik
6
History of Mobile and its
Application (Cont.)
Year
Name
Services
Size (cm)
Weight
(Kg)
1983
Motorola DynaTAC
8000X (called Brick)
Calling
30
1.13
1989
Motorola Microtac
9800X
Calling
23
0.35
1992
Motorola International
3200
Calling (GSM)
19.5
0.5
1993
Nokia 1011
Calling (GSM)
19.5
0.4
1994
IBM Simon
Calling
20
0.5
1996
Motorola Strartac
Calling
9.4
0.088
1996
Nokia 8810
Calling
14.4
0.145
2017
iPhone and Samsung
Mobile Application - Ishik
What you see in them?
7
WAP and mobile
application
• The first need to mobile application is Internet
connection.
• Internet connection, for mobile, could be achieved
through a protocol called Wireless Application
Protocol.
o It exactly works as (HTTP – Hypertext Transfer Protocol).
• Another jump of mobile platform is Internet
connection suitability.
Mobile Application - Ishik
8
Mobile Application
• They are applications that specially developed for
handy devices, such as mobiles, tablets, and iPad.
• The way differ from other applications is
o
o
o
o
o
o
o
their Operating systems (OS):
• Android
• iOS
They are not so complex
Most times, they are free
Easy to develop and use
No need much memory spaces
Have simple graphical user interface (GUI).
Mostly, they are life style based applications.
Mobile Application - Ishik
9
Mobile Application
(Cont.)
• Mobile applications differ from each other only in the
platform they designed for.
• There are a lot of mobile platform,
o
o
o
o
o
o
Android
iOS
Windows
Blackberry OS
Java Micro Edition
Symbian OS
• The most well-known platforms are Android and iOS
• Each has its own features that enabling them doing
great daily requirements.
Mobile Application - Ishik
10
Android VS iOS
Features
Android
iOS
Programming language
Java (Easy for learn even
for beginners)
Object-C and Swift,
needs more line to code
Development tool
Android Studio
Free of charge
Xcode
Need to pay 99$ per year
Customizable (suit for
specific using or user)
Yes
Limited, need jailbreak
for extensive use.
Last version
6.0 – 6.0.1
Marshmallow
iOS 9.2.1
Open source
Yes
No
Supported devices
Many brands (Motorola,
Samsung, HTC, LC,
Nexus
Only devices that made
by Apple company
Voice assist
Yes, there are many
applications
Yes, only with Siri
Mobile Application - Ishik
11
What is Android?
• What is Android?
o Is it application?
o Is it middleware?
o Operating System (OS)?
• It is actually, A complete software stack for mobile
devices that contain OS, middleware, and
applications.
• The OS uses Kernel based Linux 3.4
• It has a lot of features:
o DVK (Dalvik Virtual Machine), Integrated Browser, SQLite, and GSM
Telephony .. etc.
Mobile Application - Ishik
12
Android-Why?
• Why so much talk about Android?
o Flexibility and scalability.
o Robustness; based on the Linux 3.4
o End user is the King.
o Developer Community Support.
o Fragmentation.
• Open Handset Alliance (OHA) – consortium of several companies
formed in 2007.
Mobile Application - Ishik
13
Open Handset Alliance
Mobile Application - Ishik
14
Smartphone Markets
Mobile Application - Ishik
15
Android OS Architecture
Mobile Application - Ishik
16
Linux Kernel
• The Linux 3.4 kernel handles core system services.
• It acts as a hardware abstraction layer (HAL) between the
physical hardware of the device and the Android software
stack.
• Some of the core functions the kernel handles include
o
o
o
o
o
Enforcement of application permissions and security
Low-level memory management
Process management and threading
The network stack
Display, keypad input, camera, Wi-Fi, Flash memory, audio,
binder inter-process communication (IPC), and power
management driver access
Mobile Application - Ishik
17
Native Libraries
• C/C++ libraries exposing various capabilities
through Android application framework.
o
o
o
o
o
o
o
o
Libc;
SGL/OpenGL; 2D/3D graphical support
Freetype: bitmap and vector font rendering.
SQLite; Lightweight relational database engine.
Surface management; manages access to display subsystems.
LibWebCore, Modern web browser powered by Android.
Media Libraries: Supports many video and audio formats.
Secure Sockets layer cryptographic protocol to secure internet
communication.
Mobile Application - Ishik
18
Android Runtime
Mobile Application - Ishik
19
Android Runtime (Cont.)
•
Each Android application runs in
a separate process
•
Each process has its own
instance
of
the
Dalvik
virtual machine (VM).
•
Based on the Java VM, the
Dalvik
design
has
been
optimized for mobile devices.
•
The Dalvik VM has a small
memory footprint and optimized
application
loading,
and
multiple instances of the Dalvik
VM can run concurrently on a
devic.
Mobile Application - Ishik
20
Security and Permissions
• There are many security measures insuring the
security of the Android OS;
o Application as OS user
o Explicitly define application permissions.
o Limited Ad hoc permissions
o Application Signing for Trust Relationship
o Multiple users and Restricted Profiles
o Google Play Developer Registration
Mobile Application - Ishik
21
Security and Permissions
Application as OS User
• When installed, for an application
o A new user profile will be associated with the installed application.
o Unique user will be given to each application.
o When run, each application treats as a different user, with its own private
file in the file system.
o Each application will be associated with a unique user ID and secure
operating environment.
o The application executes in its own process with its own instance of the
Dalvik VM and under its own user ID on the operating system.
Mobile Application - Ishik
22
Security and Permissions
Explicitly define application permissions
• It is about access shared resources.
• Android applications register for a specific privilege they
required.
• Some they privilege device functionality:
o Making calls
o Accessing network
o Controlling camera and other hardware sensors.
• Some applications need privilege to shared data:
o
o
o
o
Private and personal information.
User preference
Location
Contact number
• Some times their own permission (read or read and write)
permissions to other applications.
Mobile Application - Ishik
23
Security and Permissions
Limited Ad Hoc Permissions
• Applications that act as content providers might
want to provide some on-the-fly permissions to
other applications for specific information they want
to share openly.
• This is done using ad hoc granting and revoking of
access to specific resources using Uniform
Resource Identifiers (URIs).
• For sharing data with URI, no more user permissions
are asking.
o Permission for contact birthday to other applications.
Mobile Application - Ishik
24
Security and Permissions
Application Signing for Trust relationship1
Multiple Users and Restricted Profile2
• (1) is about building a trusted authentication
between users and developers. In Android, self
certificate is preferred.
• (2), from Android 4.7 (API Level 17), supporting
multiple user account on a sharable Android
device is enabled.
Mobile Application - Ishik
25
Security and Permissions
Google Play Developer Registration
• To publish applications on the popular Google Play
store, developers must create a developer
account. The Google Play store is managed closely
and no malware is tolerated.
Mobile Application - Ishik
26
Application Framework
• The Android application framework provides everything
necessary to implement an average application.
• The Android application lifecycle involves the following
key
components:
o
o
o
o
o
o
Activities are functions that the application performs.
Groups of views define the application’s layout.
Intents inform the system about an application’s plans.
Services allow for background processing without user interaction.
Notifications alert the user when something interesting happens.
Content providers facilitate data transmission among different applications.
Mobile Application - Ishik
27
Application Services
• Through a collection of managers, applications can
interact with the OS and underlining hardware.
• Those managers are responsible of a specific
services, such as:
o The LocationManager facilitates interaction with the location-based
services available on the device.
o The ViewManager and WindowManager manage display and user
interface fundamentals related to the device.
o The AccessibilityManager manages accessibility events, facilitating
device support for users with physical impairments.
o The ClipboardManager provides access to the global clipboard for the
device, for cutting and pasting content.
o The DownloadManager manages HTTP downloads in the background as a
system service.
o The FragmentManager manages the fragments of an activity.
o The AudioManager provides access to audio and ringer controls.
Mobile Application - Ishik
28
Applications Types
• Android ships with a set of core applications, e.g.
Contacts, Calendars, ….
• Most applications developer’s sits here with other
core applications.
• Even the Google applications use the same public
API that is available for open developer community.
• All applications are written using Java
Mobile Application - Ishik
29
Application Fundamental
How is .apk file generated?
Application Resources
AAPT
Application Source Code
R. Java
Compiled
Resources
3rd Parties Libraries
Android
Package
(.apk file)
Mobile Application - Ishik
Java
Compiler
APK
Builder
Tool
Java Interface
.class
files
Dox
Tool
.dex file
30
Class End
Mobile Application - Ishik
31