SlideShare uma empresa Scribd logo
1 de 60
Mobile Application Development
BSCS-7
Lecture # 1
Compulsory Reading Material
• The Android™ Developer’s Cookbook-Building
Applications with the Android SDK,
• by Ronan Schwarz, Phil Dutson, James
Steele, Nelson To (2nd Edition)
• Learning Android (O’Reilly publisher) by Marko
Garenta
Prerequisites
Assessment & Evaluation Criteria
• Quizzes 10 %
• Assignments 10 %
• Mid Term 20 %
• Project 10 %
• Final Term 50 %
• Total: 100 %
• Object Oriented Programming using Java
Android Overview
•Android (Google) is a widely anticipated open
source operating system for mobile devices,
•Supporting
Bluetooth (wireless for short distance)
Wi-Fi (wireless for 150 feet indoors, 300 ft outdoors)
3G(200 kbits/sec) and 4G (100 Mbit -1Gbit/sec)
•Android software stack
–Android Linux operating system
–Middleware(Dalvik Runtime Optimized Java virtual
machineVM, Java API) and Library(Phone, contact,
GPS map, SQLite, OpenGL.)
Android Architecture
Linux kernel Layer
• Android relies on Linux kernel
• 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
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
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
Applications Layer
• 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
Features of Android
• Popularity (High market share)
• AWAT
• 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
Cont.
• Hot job market
– Market for mobile software surges from $4.1
billion in 2009 to $17.5 billion by 2012
– 2010 Dice.com survey: 60% for Android
– Dice.com: mobile app developers made
$85,000 in 2010 and salaries expected to
rise2
android devices
Mobile phones SmartTV Wearable device
Tablets GPS device for automobiles
Origin of android
Android was founded in Palo Alto, California in
October 2003 by
Andy Rubin, Rich Miner,
Nick Sears and Chris White who work at “
” to develop.
Andy Rubin
…Origin of android
 Android was purchased by the
in AUGUST, 2005 for 50 million $.
 HTC Dream was the first android device
launched in September 2008
 Now, android covers 90% of the mobile OS
market.
Open Handset Alliance (OHA)
 It’s consortium of several companies.
 OHA is a business alliance of firm to develop open
standard for mobile device.
 OHA includes 84 firms to develop open standard for
mobile devices, i.e.
HTC, Sony, Dell, Intel, Motorola, QUALCOMM, Google
, Samsung Electronics, LG Electronics,T-Mobile, NVidias
 Reason for Nokia not to developAndroid Mobiles
is Nokia is not part of OHA
• Categories of Android applications
History of Android
•The code names of android ranges from A to L currently, such as Aestro, Blender, etc…
Introduction to Android
Features
 Android supports wireless communication using:-
3G Networks, 4G Networks, 802.11Wi-Fi Networks,
Bluetooth Connectivity
 Developing an android application is not tough
,using SDK and java emulator we can easily develop
applications that we want.
 Open source – Free development platform
 Built in services like GPS,SQL Database, browser
and maps
 Portability across current and future hardware
android Versions
 Android Astro 1.0
• Released on September 23, 2008.
 Android Cupcake 1.5
• Released on April 30, 2009.
 Android Donut 1.6
• Released on September 15, 2009.
 Android Éclair 2.0/2.1
• Released on October 26, 2009.
 Android Froyo 2.2
• Released on May 20, 2010.
 Android Gingerbread 2.3
• Released on December 6, 2010
 Android Honeycomb 3.0
• Released on February 22, 2011.
 Android IceCream Sandwich 4.0
• Released on November 14, 2011
 Android JellyBean 4.1
• Released on June 27,2012
 Android Kitkat 4.4
• Released on October 31,2013
android Versions
 Android Lollipop 5.0
• Released on November 12, 2014
 Android Marshmallow 6.0
• Released on May 28, 2015
 Android Nougat 7.0
• Released on August 22, 2016
 Android Oreo 8.0
• Released on August 21, 2017
• Latest version till date.
UI comparison
Android Oreo 8.0
Android Astro 1.0 Android KitKat 4.4
Architecture
Linux kernel
Libraries
Android run time
- Core libraries
- Dalvik virtual machine
Application layer
Application framework
Android Runtime
 Android includes a set of core libraries that provides most
of the functionality available in the core libraries of the Java
programming language.
 DalvikVM.
• Dex files
• Compact and efficient than class files
• Limited memory and battery power
 Core Libraries
• Java 5 Std edition
• Collections, I/O etc…
• Providing most of the functionality available in the
core libraries of the Java language.
Core Libraries
Dalvik Virtual
Machine
Libraries
Android includes a set of:
 C/C++ libraries
 Interface through Java
 Surface manager – Handling UI Windows with 2D and
3D graphics
 Media codes, SQLite, Browser engine
The Android Studio 3.1 supports new set of library :
Application Framework
The application architecture is designed to simplify the reuse
of components
 Activity manager – manages application life cycle
 Android provides a set of core applications:
 Email Client
 SMS Program
 Calendar
 Maps
 Browser
 Contacts, Etc.
 All applications are written using the Java language.
 APIs: Data Structures, Utilities, File Access, Network Access,
Graphics, etc.
Application Development
Android
Emulator
Android
Mobile
Device
Android
SDK
Limitations
• screen size
• battery life time
• processor capacity
• Slow network access and Web browser
• Input: soft keyboard, phone keypad, touch
screen, or stylus
• Security
Android App software components
– Activity
– Service
– Broadcast Receiver
– Intent
– Content Provider
Android App Development Tutorial:
http://www.slideserve.com/lyndon/android-development-tutorial
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
• Services execute background processing, no
visual interface
Ex: Downloads, Playing Music, TCP/UDP Server
• You can bind to an existing service, control its
operation, and run in background
• Play music, alarm clock, etc.
• Secured if using permissions
• Callers may need to verify that service is the
correct one
Content provider
• Content providers are data storage facilities
which supports data exchange between
applications
• Make data available to other applications
• Transfer data between applications in Android
• Other applications use a ContentResolver
object to access the data provided via a
ContentProvider
ContentProviders
• Generally SQL backend
• Used to share content between apps
• Access controlled through permission tags
• Apps can be dynamically authorized access
control
– Possible security hole
• Must protect against SQL injection
– verify input using parameterization
Broadcast receivers
• Broadcast receivers 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.
Broadcast receivers
• Act as receivers for multiple components
• Provide secure IPC
• Done by specifying permissions on
BroadcastReceiver regarding sender
• Otherwise, behave like activities in terms of IPC
– Can’t define permission
• Don’t send sensitive data
Component life cycle
• 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
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(cont.)
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)
Intent Filters
• Used to determine recipient of Intent
• Specify the main entrance for activities
• A user interface consists of a series of
Activities
• Each Activity is a “screen”.
• Intent may leave a security flaw (hole)
–Solution: Intents explicitly define
receiver
@2011 Mihail L. Sichitiu 38
Goal
• Understand applications and their
components
• Concepts:
– activity,
– service,
– broadcast receiver,
– content provider,
– intent,
– AndroidManifest
@2011 Mihail L. Sichitiu 39
Applications
• Written in Java (it’s possible to write native
code – will not cover that here)
• Good separation (and corresponding
security) from other applications:
– Each application runs in its own process
– Each process has its own separate VM
– Each application is assigned a unique Linux
user ID – by default files of that application
are only visible to that application (can be
explicitly exported)
40
Application Components
• Activities – visual user interface focused
on a single thing a user can do
• Services – no visual interface – they run in
the background
• Broadcast Receivers – receive and react
to broadcast announcements
• Content Providers – allow data exchange
between applications
41
Activities
• 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
42
Activities – The View
• Each activity has a default window to draw
in (although it may prompt for dialogs or
notifications)
• The content of the window is a view or a
group of views (derived from View or
ViewGroup)
• Example of views: buttons, text fields,
scroll bars, menu items, check boxes, etc.
• View(Group) made visible via
Activity.setContentView() method.
43
Services
• Does not have a visual interface
• Runs in the background indefinitely
• Examples
– Network Downloads
– Playing Music
– TCP/UDP Server
• You can bind to a an existing service and
control its operation
44
Broadcast Receivers
• Receive and react to broadcast
announcements
• Extend the class BroadcastReceiver
• Examples of broadcasts:
– Low battery, power connected, shutdown,
timezone changed, etc.
– Other applications can initiate broadcasts
45
Content Providers
• Makes some of the application data
available to other applications
• It’s the only way to transfer data between
applications in Android (no shared files,
shared memory, pipes, etc.)
• Extends the class ContentProvider;
• Other applications use a ContentResolver
object to access the data provided via a
ContentProvider
46
Intents
• An intent is an Intent object with a message content.
• Activities, services and broadcast receivers are started
by intents. ContentProviders are 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()
47
Shutting down 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
48
Android Manifest
• Its main purpose in life is to declare the
components to the system:
<?xml version="1.0" encoding="utf-8"?>
<manifest . . . >
<application . . . >
<activity
android:name="com.example.project.FreneticActiv
ity"
android:icon="@drawable/small_pic.pn
g"
android:label="@string/freneticLabel"
. . . >
</activity>
. . .
</application>
</manifest>
49
Intent Filters
• Declare Intents handled by the current application (in the
AndroidManifest):
<?xml version="1.0" encoding="utf-8"?>
<manifest . . . >
<application . . . >
<activity android:name="com.example.project.FreneticActivity"
android:icon="@drawable/small_pic.png"
android:label="@string/freneticLabel"
. . . >
<intent-filter . . . >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter . . . >
<action android:name="com.example.project.BOUNCE" />
<data android:mimeType="image/jpeg" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
. . .
</application>
</manifest>
Shows in the
Launcher and
is the main
activity to
start
Handles JPEG
images in
some way
Conclusion
Android is a truly open, free development
platform based on Linux and open source.
Handset makers can use and customize the
platform without paying a royalty.
Android is now stepping up in next level of
mobile internet.
 Android is open to all: industry, developers and
users
Google Android is stepping into the next level
of Mobile Internet & that is the reason that
android covers 90% of mobile OS market
• OS
• Android application development on either of the following operating
systems:
– Microsoft Windows.
– Mac OS X 10.5.8 or later version with Intel chip.
– Linux including GNU C Library 2.7 or later.
• Tools
• All the required tools to develop Android applications are freely
available and can be downloaded from the Web. Following is the list
of software's you will need before you start your Android application
programming.
1. Java JDK5 or later version
2. Android Studio / Android SDK and Eclipse IDE for Java Developers
(optional) and Android Development Tools (ADT) Eclipse Plug-in
(optional)
Requirements for Android
• Download Android Studio
• From http://developer.android.com/sdk/installing/index.html
• System Requirements for Windows
• Microsoft® Windows® 8/7/Vista (32 or 64-bit)
• 2 GB RAM minimum, 4 GB RAM recommended
• 400 MB hard disk space
• At least 1 GB for Android SDK, emulator system images, and caches
• 1280 x 800 minimum screen resolution
• Java Development Kit (JDK) 7
• Optional for accelerated emulator: Intel® processor with support for
Intel® VT-x, Intel® EM64T (Intel® 64), and Execute Disable (XD) Bit
functionality
Requirements for Android
• Java
1. Visit http://www.oracle.com/technetwork/java/javase/downloads/index.html
2. Install it.
• Android Studio
3. Visit http://developer.android.com/sdk/index.html
4. click the button Download Android Studio.
5. Accept terms, and click Download.
6. Run executable file of setup.
7. Follow the setup wizard to install Android Studio and any necessary SDK tools.
8. On some Windows systems, the launcher script does not find where Java is installed.
If you encounter this problem, you need to set an environment variable indicating the
correct location.
9. Select Start menu > Computer > System Properties > Advanced System Properties.
Then open Advanced tab > Environment Variables and add a new system variable
JAVA_HOME that points to your JDK folder, for example C:Program
FilesJavajdk1.7.0_45
Installation
10.The individual tools and other SDK packages are saved outside the
Android Studio application directory. If you need to access the tools
directly, use a terminal to navigate to the location where they are
installed. For example:
11.Users<user>sdk
12.Android Studio is now ready and loaded with the Android developer
tools, but there are still a couple packages you should add to make
your Android SDK complete.
• Run
1. Run Android Studio as Administrator.
2. Before you create new project, click Configure from splash screen.
Click SDK Manager.
3. Don’t select all. In bottom, in Extra section, select Intel x86 Emulator
Accelerator.
4. Click Install button.
Installation
• The Android SDK includes a mobile device
emulator — a virtual mobile device that runs on
your computer. The emulator lets you develop
and test Android applications without using a
physical device.
• Limitations
• No support for placing or receiving actual
phone calls. You can simulate phone calls
(placed and received) through the emulator
console, however.
Android Emulator
• The AVD android virtual device Manager provides a graphical user interface in which you can create and
manage Android Virtual Devices (AVDs), which are required by the Android Emulator.
Android Studio
• Tools > Android > AVD Manager
AVD Manager
• Genymotion
• It is a fast third party Android emulator for app testing and
presentation on Windows that can be used instead of the default
Android emulator. In some cases it's as good as or better than
developing on actual devices!
1. Visit https://www.genymotion.com
2. Click Free version. Click Get Genymotion.
3. Create a Genymotion account, sign in.
4. Download and install Genymotion.
• Run Genymotion
1. First time you have to sign in with your credentials. It will connect with
cloud and provide available virtual devices.
2. Add your desired virtual device.
Optional Installation - Genymotion
References
https://en.wikipedia.org/wiki/Androi
d_(operati ng_system)
https://www.android.com/
https://www.androidauthority.com/
https://techterms.com
http://www.openhandsetalliance.co
m/
• Images and Clipart:
Reference
1.http://www.businessweek.com/technology/content/oct2010/tc201
01020_639668.htm
2. http://it-jobs.fins.com/Articles/SB129606993144879991/Mobile-
App-Developers-Wanted-at-Ad-Agencies
3.http://www.gartner.com/it/page.jsp?id=1466313
4.http://developer.android.com/guide/developing/index.html
5.Android Overview,
http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd
=7&ved=0CEcQFjAG&url=http%3A%2F%2Fai.arizona.edu%2Fmis5
10%2Fslides%2FAndroid%2520Overview.ppt&ei=4HBXUNPvMuPe
0QGm3oCYCg&usg=AFQjCNE2Li9vyh34rECKYDuOjKjI5pjyzw&sig
2=E-wfIL1bPNJacCi6ZaAWCA
6. Mobile Application Security on Android, Originally presented by
Jesse Burns at Black Hat 2009
Thank you.
•Any Query ?
• ask google

Mais conteúdo relacionado

Mais procurados

android architecture
android architectureandroid architecture
android architecture
Aashita Gupta
 
android phone feature and value for user
android phone feature and value for userandroid phone feature and value for user
android phone feature and value for user
Sudhir Kumar
 

Mais procurados (20)

android architecture
android architectureandroid architecture
android architecture
 
PPT on Android
PPT on AndroidPPT on Android
PPT on Android
 
Evolution of android operating system
Evolution of android operating systemEvolution of android operating system
Evolution of android operating system
 
Android architecture
Android architectureAndroid architecture
Android architecture
 
Introduction to Android
Introduction to Android Introduction to Android
Introduction to Android
 
Seminar Report on Android OS
Seminar Report on Android OSSeminar Report on Android OS
Seminar Report on Android OS
 
Android report.
Android report.Android report.
Android report.
 
Android OS by Prasad & Sarang
Android OS by Prasad & SarangAndroid OS by Prasad & Sarang
Android OS by Prasad & Sarang
 
Android OS
Android OSAndroid OS
Android OS
 
Android Training Report
Android Training ReportAndroid Training Report
Android Training Report
 
android phone feature and value for user
android phone feature and value for userandroid phone feature and value for user
android phone feature and value for user
 
android phone ppt
android phone pptandroid phone ppt
android phone ppt
 
Introduction to Android - Seminar
Introduction to Android - SeminarIntroduction to Android - Seminar
Introduction to Android - Seminar
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Short notes of android
Short notes of androidShort notes of android
Short notes of android
 
Android
AndroidAndroid
Android
 
Android Basic Concept
Android Basic Concept Android Basic Concept
Android Basic Concept
 
Android Platform Architecture
Android Platform ArchitectureAndroid Platform Architecture
Android Platform Architecture
 
Android
AndroidAndroid
Android
 
Basic android-ppt
Basic android-pptBasic android-ppt
Basic android-ppt
 

Semelhante a Mobile appliaction w android week 1 by osama

18ITT61 - Introduction.pptx
18ITT61 - Introduction.pptx18ITT61 - Introduction.pptx
18ITT61 - Introduction.pptx
MugiiiReee
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
Jindal Gohil
 
Introduction to Android
Introduction to AndroidIntroduction to Android
Introduction to Android
NitinMehra2205
 

Semelhante a Mobile appliaction w android week 1 by osama (20)

Android quick talk
Android quick talkAndroid quick talk
Android quick talk
 
18ITT61 - Introduction.pptx
18ITT61 - Introduction.pptx18ITT61 - Introduction.pptx
18ITT61 - Introduction.pptx
 
Android programming Assignment Help
Android programming Assignment HelpAndroid programming Assignment Help
Android programming Assignment Help
 
Android
AndroidAndroid
Android
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Introduction to Android
Introduction to AndroidIntroduction to Android
Introduction to Android
 
Introduction to Android.ppt
Introduction to Android.pptIntroduction to Android.ppt
Introduction to Android.ppt
 
My androidpresentation
My androidpresentationMy androidpresentation
My androidpresentation
 
android
androidandroid
android
 
Android Introduction
Android IntroductionAndroid Introduction
Android Introduction
 
Introduction to Android
Introduction to AndroidIntroduction to Android
Introduction to Android
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Android presentation slide
Android presentation slideAndroid presentation slide
Android presentation slide
 
Synapseindia android apps overview
Synapseindia android apps overviewSynapseindia android apps overview
Synapseindia android apps overview
 
Android
AndroidAndroid
Android
 
Android 130923124440-phpapp01
Android 130923124440-phpapp01Android 130923124440-phpapp01
Android 130923124440-phpapp01
 
Hello androidforyarlmeetup
Hello androidforyarlmeetupHello androidforyarlmeetup
Hello androidforyarlmeetup
 
Google android os
Google android osGoogle android os
Google android os
 
android
androidandroid
android
 
Introduction to Android (before 2015)
Introduction to Android (before 2015)Introduction to Android (before 2015)
Introduction to Android (before 2015)
 

Mais de Osama Ghandour Geris

Mais de Osama Ghandour Geris (20)

functions in python By Eng. Osama Ghandour الدوال فى البايثون مع مهندس اسامه ...
functions in python By Eng. Osama Ghandour الدوال فى البايثون مع مهندس اسامه ...functions in python By Eng. Osama Ghandour الدوال فى البايثون مع مهندس اسامه ...
functions in python By Eng. Osama Ghandour الدوال فى البايثون مع مهندس اسامه ...
 
Python week 5 2019-2020 for G10 by Eng.Osama Ghandour.ppt
Python week 5 2019-2020 for G10 by Eng.Osama Ghandour.pptPython week 5 2019-2020 for G10 by Eng.Osama Ghandour.ppt
Python week 5 2019-2020 for G10 by Eng.Osama Ghandour.ppt
 
Python cs.1.12 week 10 2020 2021 covid 19 for g10 by eng.osama mansour
Python cs.1.12 week 10  2020 2021 covid 19 for g10 by eng.osama mansourPython cs.1.12 week 10  2020 2021 covid 19 for g10 by eng.osama mansour
Python cs.1.12 week 10 2020 2021 covid 19 for g10 by eng.osama mansour
 
Python cs.1.12 week 9 10 2020-2021 covid 19 for g10 by eng.osama ghandour
Python cs.1.12 week 9 10  2020-2021 covid 19 for g10 by eng.osama ghandourPython cs.1.12 week 9 10  2020-2021 covid 19 for g10 by eng.osama ghandour
Python cs.1.12 week 9 10 2020-2021 covid 19 for g10 by eng.osama ghandour
 
Python week 7 8 2019-2020 for grade 10
Python week 7 8 2019-2020 for grade 10Python week 7 8 2019-2020 for grade 10
Python week 7 8 2019-2020 for grade 10
 
Python week 6 2019 2020 for grade 10
Python week 6 2019 2020 for grade 10 Python week 6 2019 2020 for grade 10
Python week 6 2019 2020 for grade 10
 
Python week 5 2019 2020 for g10 by eng.osama ghandour
Python week 5 2019 2020 for g10 by eng.osama ghandourPython week 5 2019 2020 for g10 by eng.osama ghandour
Python week 5 2019 2020 for g10 by eng.osama ghandour
 
Python week 4 2019 2020 for g10 by eng.osama ghandour
Python week 4 2019 2020 for g10 by eng.osama ghandourPython week 4 2019 2020 for g10 by eng.osama ghandour
Python week 4 2019 2020 for g10 by eng.osama ghandour
 
Programming intro variables constants - arithmetic and assignment operators
Programming intro variables   constants - arithmetic and assignment operatorsProgramming intro variables   constants - arithmetic and assignment operators
Programming intro variables constants - arithmetic and assignment operators
 
Python week 1 2020-2021
Python week 1 2020-2021Python week 1 2020-2021
Python week 1 2020-2021
 
6 css week12 2020 2021 for g10
6 css week12 2020 2021 for g106 css week12 2020 2021 for g10
6 css week12 2020 2021 for g10
 
Css week11 2020 2021 for g10 by eng.osama ghandour
Css week11 2020 2021 for g10 by eng.osama ghandourCss week11 2020 2021 for g10 by eng.osama ghandour
Css week11 2020 2021 for g10 by eng.osama ghandour
 
Cooding history
Cooding history Cooding history
Cooding history
 
Computer networks--network
Computer networks--networkComputer networks--network
Computer networks--network
 
How to print a sketch up drawing in 3d
How to print a sketch up drawing  in 3dHow to print a sketch up drawing  in 3d
How to print a sketch up drawing in 3d
 
Google sketch up-tutorial
Google sketch up-tutorialGoogle sketch up-tutorial
Google sketch up-tutorial
 
7 types of presentation styles on line
7 types of presentation styles on line7 types of presentation styles on line
7 types of presentation styles on line
 
Design pseudo codeweek 6 2019 -2020
Design pseudo codeweek 6 2019 -2020Design pseudo codeweek 6 2019 -2020
Design pseudo codeweek 6 2019 -2020
 
Php introduction
Php introductionPhp introduction
Php introduction
 
How to use common app
How to use common appHow to use common app
How to use common app
 

Último

Último (20)

Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 

Mobile appliaction w android week 1 by osama

  • 1.
  • 3. Compulsory Reading Material • The Android™ Developer’s Cookbook-Building Applications with the Android SDK, • by Ronan Schwarz, Phil Dutson, James Steele, Nelson To (2nd Edition) • Learning Android (O’Reilly publisher) by Marko Garenta Prerequisites Assessment & Evaluation Criteria • Quizzes 10 % • Assignments 10 % • Mid Term 20 % • Project 10 % • Final Term 50 % • Total: 100 % • Object Oriented Programming using Java
  • 4. Android Overview •Android (Google) is a widely anticipated open source operating system for mobile devices, •Supporting Bluetooth (wireless for short distance) Wi-Fi (wireless for 150 feet indoors, 300 ft outdoors) 3G(200 kbits/sec) and 4G (100 Mbit -1Gbit/sec) •Android software stack –Android Linux operating system –Middleware(Dalvik Runtime Optimized Java virtual machineVM, Java API) and Library(Phone, contact, GPS map, SQLite, OpenGL.)
  • 6. Linux kernel Layer • Android relies on Linux kernel • 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
  • 7. 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
  • 8. 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
  • 9. Applications Layer • 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
  • 10. Features of Android • Popularity (High market share) • AWAT • 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
  • 11. Cont. • Hot job market – Market for mobile software surges from $4.1 billion in 2009 to $17.5 billion by 2012 – 2010 Dice.com survey: 60% for Android – Dice.com: mobile app developers made $85,000 in 2010 and salaries expected to rise2
  • 12. android devices Mobile phones SmartTV Wearable device Tablets GPS device for automobiles
  • 13. Origin of android Android was founded in Palo Alto, California in October 2003 by Andy Rubin, Rich Miner, Nick Sears and Chris White who work at “ ” to develop. Andy Rubin
  • 14. …Origin of android  Android was purchased by the in AUGUST, 2005 for 50 million $.  HTC Dream was the first android device launched in September 2008  Now, android covers 90% of the mobile OS market.
  • 15. Open Handset Alliance (OHA)  It’s consortium of several companies.  OHA is a business alliance of firm to develop open standard for mobile device.  OHA includes 84 firms to develop open standard for mobile devices, i.e. HTC, Sony, Dell, Intel, Motorola, QUALCOMM, Google , Samsung Electronics, LG Electronics,T-Mobile, NVidias  Reason for Nokia not to developAndroid Mobiles is Nokia is not part of OHA
  • 16. • Categories of Android applications History of Android •The code names of android ranges from A to L currently, such as Aestro, Blender, etc… Introduction to Android
  • 17. Features  Android supports wireless communication using:- 3G Networks, 4G Networks, 802.11Wi-Fi Networks, Bluetooth Connectivity  Developing an android application is not tough ,using SDK and java emulator we can easily develop applications that we want.  Open source – Free development platform  Built in services like GPS,SQL Database, browser and maps  Portability across current and future hardware
  • 18. android Versions  Android Astro 1.0 • Released on September 23, 2008.  Android Cupcake 1.5 • Released on April 30, 2009.  Android Donut 1.6 • Released on September 15, 2009.  Android Éclair 2.0/2.1 • Released on October 26, 2009.  Android Froyo 2.2 • Released on May 20, 2010.  Android Gingerbread 2.3 • Released on December 6, 2010  Android Honeycomb 3.0 • Released on February 22, 2011.  Android IceCream Sandwich 4.0 • Released on November 14, 2011  Android JellyBean 4.1 • Released on June 27,2012  Android Kitkat 4.4 • Released on October 31,2013
  • 19. android Versions  Android Lollipop 5.0 • Released on November 12, 2014  Android Marshmallow 6.0 • Released on May 28, 2015  Android Nougat 7.0 • Released on August 22, 2016  Android Oreo 8.0 • Released on August 21, 2017 • Latest version till date.
  • 20. UI comparison Android Oreo 8.0 Android Astro 1.0 Android KitKat 4.4
  • 21. Architecture Linux kernel Libraries Android run time - Core libraries - Dalvik virtual machine Application layer Application framework
  • 22. Android Runtime  Android includes a set of core libraries that provides most of the functionality available in the core libraries of the Java programming language.  DalvikVM. • Dex files • Compact and efficient than class files • Limited memory and battery power  Core Libraries • Java 5 Std edition • Collections, I/O etc… • Providing most of the functionality available in the core libraries of the Java language. Core Libraries Dalvik Virtual Machine
  • 23. Libraries Android includes a set of:  C/C++ libraries  Interface through Java  Surface manager – Handling UI Windows with 2D and 3D graphics  Media codes, SQLite, Browser engine The Android Studio 3.1 supports new set of library :
  • 24. Application Framework The application architecture is designed to simplify the reuse of components  Activity manager – manages application life cycle  Android provides a set of core applications:  Email Client  SMS Program  Calendar  Maps  Browser  Contacts, Etc.  All applications are written using the Java language.  APIs: Data Structures, Utilities, File Access, Network Access, Graphics, etc.
  • 26. Limitations • screen size • battery life time • processor capacity • Slow network access and Web browser • Input: soft keyboard, phone keypad, touch screen, or stylus • Security
  • 27. Android App software components – Activity – Service – Broadcast Receiver – Intent – Content Provider Android App Development Tutorial: http://www.slideserve.com/lyndon/android-development-tutorial
  • 28. 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
  • 29. Service • Services execute background processing, no visual interface Ex: Downloads, Playing Music, TCP/UDP Server • You can bind to an existing service, control its operation, and run in background • Play music, alarm clock, etc. • Secured if using permissions • Callers may need to verify that service is the correct one
  • 30. Content provider • Content providers are data storage facilities which supports data exchange between applications • Make data available to other applications • Transfer data between applications in Android • Other applications use a ContentResolver object to access the data provided via a ContentProvider
  • 31. ContentProviders • Generally SQL backend • Used to share content between apps • Access controlled through permission tags • Apps can be dynamically authorized access control – Possible security hole • Must protect against SQL injection – verify input using parameterization
  • 32. Broadcast receivers • Broadcast receivers 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.
  • 33. Broadcast receivers • Act as receivers for multiple components • Provide secure IPC • Done by specifying permissions on BroadcastReceiver regarding sender • Otherwise, behave like activities in terms of IPC – Can’t define permission • Don’t send sensitive data
  • 34. Component life cycle • 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
  • 35. 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).
  • 36. Intent(cont.) 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)
  • 37. Intent Filters • Used to determine recipient of Intent • Specify the main entrance for activities • A user interface consists of a series of Activities • Each Activity is a “screen”. • Intent may leave a security flaw (hole) –Solution: Intents explicitly define receiver
  • 38. @2011 Mihail L. Sichitiu 38 Goal • Understand applications and their components • Concepts: – activity, – service, – broadcast receiver, – content provider, – intent, – AndroidManifest
  • 39. @2011 Mihail L. Sichitiu 39 Applications • Written in Java (it’s possible to write native code – will not cover that here) • Good separation (and corresponding security) from other applications: – Each application runs in its own process – Each process has its own separate VM – Each application is assigned a unique Linux user ID – by default files of that application are only visible to that application (can be explicitly exported)
  • 40. 40 Application Components • Activities – visual user interface focused on a single thing a user can do • Services – no visual interface – they run in the background • Broadcast Receivers – receive and react to broadcast announcements • Content Providers – allow data exchange between applications
  • 41. 41 Activities • 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
  • 42. 42 Activities – The View • Each activity has a default window to draw in (although it may prompt for dialogs or notifications) • The content of the window is a view or a group of views (derived from View or ViewGroup) • Example of views: buttons, text fields, scroll bars, menu items, check boxes, etc. • View(Group) made visible via Activity.setContentView() method.
  • 43. 43 Services • Does not have a visual interface • Runs in the background indefinitely • Examples – Network Downloads – Playing Music – TCP/UDP Server • You can bind to a an existing service and control its operation
  • 44. 44 Broadcast Receivers • Receive and react to broadcast announcements • Extend the class BroadcastReceiver • Examples of broadcasts: – Low battery, power connected, shutdown, timezone changed, etc. – Other applications can initiate broadcasts
  • 45. 45 Content Providers • Makes some of the application data available to other applications • It’s the only way to transfer data between applications in Android (no shared files, shared memory, pipes, etc.) • Extends the class ContentProvider; • Other applications use a ContentResolver object to access the data provided via a ContentProvider
  • 46. 46 Intents • An intent is an Intent object with a message content. • Activities, services and broadcast receivers are started by intents. ContentProviders are 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()
  • 47. 47 Shutting down 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
  • 48. 48 Android Manifest • Its main purpose in life is to declare the components to the system: <?xml version="1.0" encoding="utf-8"?> <manifest . . . > <application . . . > <activity android:name="com.example.project.FreneticActiv ity" android:icon="@drawable/small_pic.pn g" android:label="@string/freneticLabel" . . . > </activity> . . . </application> </manifest>
  • 49. 49 Intent Filters • Declare Intents handled by the current application (in the AndroidManifest): <?xml version="1.0" encoding="utf-8"?> <manifest . . . > <application . . . > <activity android:name="com.example.project.FreneticActivity" android:icon="@drawable/small_pic.png" android:label="@string/freneticLabel" . . . > <intent-filter . . . > <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <intent-filter . . . > <action android:name="com.example.project.BOUNCE" /> <data android:mimeType="image/jpeg" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> . . . </application> </manifest> Shows in the Launcher and is the main activity to start Handles JPEG images in some way
  • 50. Conclusion Android is a truly open, free development platform based on Linux and open source. Handset makers can use and customize the platform without paying a royalty. Android is now stepping up in next level of mobile internet.  Android is open to all: industry, developers and users Google Android is stepping into the next level of Mobile Internet & that is the reason that android covers 90% of mobile OS market
  • 51. • OS • Android application development on either of the following operating systems: – Microsoft Windows. – Mac OS X 10.5.8 or later version with Intel chip. – Linux including GNU C Library 2.7 or later. • Tools • All the required tools to develop Android applications are freely available and can be downloaded from the Web. Following is the list of software's you will need before you start your Android application programming. 1. Java JDK5 or later version 2. Android Studio / Android SDK and Eclipse IDE for Java Developers (optional) and Android Development Tools (ADT) Eclipse Plug-in (optional) Requirements for Android
  • 52. • Download Android Studio • From http://developer.android.com/sdk/installing/index.html • System Requirements for Windows • Microsoft® Windows® 8/7/Vista (32 or 64-bit) • 2 GB RAM minimum, 4 GB RAM recommended • 400 MB hard disk space • At least 1 GB for Android SDK, emulator system images, and caches • 1280 x 800 minimum screen resolution • Java Development Kit (JDK) 7 • Optional for accelerated emulator: Intel® processor with support for Intel® VT-x, Intel® EM64T (Intel® 64), and Execute Disable (XD) Bit functionality Requirements for Android
  • 53. • Java 1. Visit http://www.oracle.com/technetwork/java/javase/downloads/index.html 2. Install it. • Android Studio 3. Visit http://developer.android.com/sdk/index.html 4. click the button Download Android Studio. 5. Accept terms, and click Download. 6. Run executable file of setup. 7. Follow the setup wizard to install Android Studio and any necessary SDK tools. 8. On some Windows systems, the launcher script does not find where Java is installed. If you encounter this problem, you need to set an environment variable indicating the correct location. 9. Select Start menu > Computer > System Properties > Advanced System Properties. Then open Advanced tab > Environment Variables and add a new system variable JAVA_HOME that points to your JDK folder, for example C:Program FilesJavajdk1.7.0_45 Installation
  • 54. 10.The individual tools and other SDK packages are saved outside the Android Studio application directory. If you need to access the tools directly, use a terminal to navigate to the location where they are installed. For example: 11.Users<user>sdk 12.Android Studio is now ready and loaded with the Android developer tools, but there are still a couple packages you should add to make your Android SDK complete. • Run 1. Run Android Studio as Administrator. 2. Before you create new project, click Configure from splash screen. Click SDK Manager. 3. Don’t select all. In bottom, in Extra section, select Intel x86 Emulator Accelerator. 4. Click Install button. Installation
  • 55. • The Android SDK includes a mobile device emulator — a virtual mobile device that runs on your computer. The emulator lets you develop and test Android applications without using a physical device. • Limitations • No support for placing or receiving actual phone calls. You can simulate phone calls (placed and received) through the emulator console, however. Android Emulator • The AVD android virtual device Manager provides a graphical user interface in which you can create and manage Android Virtual Devices (AVDs), which are required by the Android Emulator. Android Studio • Tools > Android > AVD Manager AVD Manager
  • 56. • Genymotion • It is a fast third party Android emulator for app testing and presentation on Windows that can be used instead of the default Android emulator. In some cases it's as good as or better than developing on actual devices! 1. Visit https://www.genymotion.com 2. Click Free version. Click Get Genymotion. 3. Create a Genymotion account, sign in. 4. Download and install Genymotion. • Run Genymotion 1. First time you have to sign in with your credentials. It will connect with cloud and provide available virtual devices. 2. Add your desired virtual device. Optional Installation - Genymotion
  • 57.
  • 60. Thank you. •Any Query ? • ask google