0% found this document useful (0 votes)
21 views26 pages

Lesson of Computing For Students

Computing presentation

Uploaded by

demo work
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views26 pages

Lesson of Computing For Students

Computing presentation

Uploaded by

demo work
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 26

Android – Architecture

Benjamin Odoi-Lartey
[email protected]
0244361636

Benjamin Odoi-Lartey Benjamin Odoi-Lartey @odlabenonline


Lecture Objectives
• Know appreciate the Android Architecture

• Know and appreciated the Android


Application, Android Framework and
Libraries and Kernel Layers.
• Know the Features of Android

• Explain the Android Application


Components
Android Architecture
Applications Layer
• Application --- (Core Applications) for
default functionalities email, SMS
messaging, calendars, internet browsing,
contacts, and more; these are APIs for
developer usage and normal user usage
• A set of core applications shipped with
Android platform
– an email client, SMS program,
calendar, maps, browser, contacts,
and others
• All written in Java

• User applications are also here


Application Framework Layer
• Simplify the reuse of components
– Applications can publish their capabilities and any other application may then
make use of those capabilities
• Applications is a set of services
– Views system, content providers, resources managers such as
• Activity Manager, manages the lifecycle of applications and provides a common
navigation backstack
• Notification Manager, enables all applications to display custom alerts in the
status bar
• Resource Manager, providing access to non-code resources such as localized
strings, graphics, and layout files
• Views, used to build an application, including lists, grids, text boxes, buttons, and
even an embeddable web browser
Library Layer
• System C libraries and function Libraries, supporting multimedia, web browser,
SQLite... Native Services to hardware
• Android runtime
Dalvik Virtual Machine
– Executes files in the Dalvik Executable (.dex) format
Java core Libraries
– Provides most of the functionality of the Java programming language.
Java core libraries rely on the Dalvik VM and the underlying Linux kernel
Every Android application runs in its own process, with its own instance of the
Dalvik virtual machine
Linux kernel Layer
• The Linux Kernel is a battle-tested piece of software that has been used in developing operating
systems for devices of wide range, from supercomputers to small gadgets. It has limited
processing abilities like small networked gadgets for the Internet of Things (IoT).
• Android relies heavily on Linux and the Kernel is responsible for many foundational functionalities
including but not limited to Device Drivers, Memory Management and Power Management.
• Supplies management of security, memory process, network, and drivers
• Acts as an abstraction layer between the hardware and the rest of the Android software stack
Android Framework Support.

8
Features of Android
• Popularity (High market share)
• Enabled SMS
• Enabled GPS
• Cameras & microphones
• Open source apps
• Development with Java
• Linux based
• Short learning curve with IDE
Java Eclipse IDE for Android
app development
• Easy deployment to mobile
device
• Easy to distribute apps via
Android Market
Share app, Sell app,
Download & reuse open source
apps
• In 2020 one of the consequences of the COVID-19 pandemic,
was a dramatic spike of demand for certain mobile app
categories.
• Number of downloads for Zoom, Google’s Meet, Microsoft’s
Teams went through the roof and, at some point, capitalization
of Zoom surpassed Boing.
• Mobile apps that were helping people to adapt and cope with the
disease became extremely popular and – to meet quickly rising
demand – companies had to heavily invest in development of
these apps to increase their capacity and bring new features.
Mobile applications developer
Developing mobile applications requires extensive knowledge of the
various mobile platforms currently available and how to develop
applications that will work on Android, iOS, Windows, and other
operating systems.

Mobile applications developers typically have experience in


programming, UX design, troubleshooting and debugging programs,
and development.

Candidates who can design mobile applications with a user-friendly


interface and who can collaborate across departments to design, test,
Bachelor’s
release, anddegree in CS
support or applications are the better options.
mobile
relevant field
Some experience in mobile
development
Analytical and problem-
solving skills
Knowledge of iOS, Android,
Objective C, HTML, XML,
JavaScript
Android App software components
• Activity
• Service
• Broadcast Receiver
• Intent
• Content Provider
Activity
• Activities provide a user interface
for one specific task, Basic
component of most applications

• Most applications have several


activities that start each other as
needed

• Each is implemented as a
subclass of the base Activity class
Service
• A service is an application component that implements
and performs long running operations in the background
without any need to interact with the user.
• Services also handle the background processing
associated with the application. A service started by an
application will be continuing to running in background
even when user switches to another application
component.
• You can bind to an existing service, control its operation,
and run in background
• Services execute background processing, no visual
interface
Ex: Downloads, Playing Music, TCP/UDP Server, Play
music, alarm clock, etc.
• Secured if using permissions
• Callers may need to verify that service is the correct one
Content provider
• Content providers : manages access to a central repository of
data and are intended to be used by other applications which uses
a provider client object.
• Content Provider also are data storage facilities which supports
data exchange between applications by making data available to
other applications
• Transfer data between applications in Android and sends data to
widgets.

• Other applications use a


ContentResolver object to
access the data provided
via a ContentProvider
ContentProviders cont…
• Generally SQL backend
• Used to share content between apps
• Access controlled through permission tags
• Apps can be dynamically authorized access control to prevent security
flaws
• Must protect against SQL injection by verifying input using parameterization
Broadcast receivers
• A broadcast receiver (receiver) is an Android component which
allows you to register for system or application events. ... For
example, applications can register for the
ACTION_BOOT_COMPLETED system event which is fired once the
Android system has completed the boot process.
• Broadcast receiver also act as mailboxes for messages from other
applications. It receives and reacts to broadcast announcements
• If an app registered the receiver in adv., the event will notify and call
back the registered software
• Ex: Low battery, power connected, shutdown, timezone changed, etc.
Intent
– Intent is a goal action component which takes care of the process
of inter-components communication (ICC)
– Intent is simply a message object containing a destination
component address and data
– Protection
– Each application executes as its own user identity, such that OS
provides system-level isolation;
– Android middleware contains a reference monitor that mediates
the inter-component communication (ICC).
Intent action:
– Start an Activity
– Broadcast events or
changes
– Start, stop, resume. or
communicate with
background Services
– Access data held by
ContentProviders
– Call back to handle
events
– Carry data with Extras
(key, value)
Android component activation
• An intent is an object which can have a message content
and start Activities, services and broadcast receivers
- ContentProvider is started by ContentResolvers
– An activity is started by Context.startActivity(Intent
intent) or Activity.startActivityForResult(Intent intent,
int RequestCode)
– A service is started by Context.startService(Intent
service)
– An application can initiate a broadcast by using an
Intent in any of Context.sendBroadcast(Intent intent),
Context.sendOrderedBroadcast(), and
Context.sendStickyBroadcast()
Shutting Down Android components
• Activities
– Can terminate itself via finish();
– Can terminate other activities it started via finishActivity();
• Services
– Can terminate via stopSelf(); or Context.stopService();
• Content Providers
– Are only active when responding to ContentResolvers
• Broadcast Receivers
– Are only active when responding to broadcasts

21
System level protection for Android app
• Each app runs as a unique user identity such that Android
can limit the potential damage of programming flaws.
• Each app runs in own VM sandbox using unique UID
• Each app requests a simple permission label assignment
model to restrict access to resources and other
applications if necessary
• Ex. of permission: Internet, camera, GPS
• Permission specifies an access policy to protect its
resources.
Android App Signature
• Application signing allows developers to identify the author of the application and to update
their application without creating complicated interfaces and permissions.
• Every application that is run on the Android platform must be signed by the developer but are
usually self-signed
• Why self signing?
– Market ties identity to developer account
– No CA in Google, Google does not have central control over the app’s signature
certificates
– No applications are trusted. No "magic key"

• What does signing determine?


– Author-update
– In signature schemes, the private key is used to sign a app or message; anyone can
check the signature using the public key.
Android Permissions
• All permission of Android’s policy are set at install time and can’t
change until the application is reinstalled.
• Android’s permission only restricts access to components and
doesn’t currently provide information flow guarantees.
• A permission is listed in app’s manifest definition XML file.

• Component A’s ability to access components B and C is determined


by comparing the access permission labels on B and C to the
collection of permission labels assigned to application A.
Permissions Levels
• User can assign permissions to applications at
– Normal Permission
– Dangerous Permission

• Art of asking permission in Android


– User should have context when you ask for permission
– If necessary explain to the user why permission is needed
– If permission denied pop-up closes app without proceeding
further with intended functionality
– Subsequent access to feature should show rationale before
popping up permission request dialog
– Subsequent request pop-ups will have “Never Ask Again”
option as Default behavior by Android

You might also like