SlideShare ist ein Scribd-Unternehmen logo
1 von 27
Android Architecture
Overview
1
2
2. Platform
• Hardware
• Operating System (Android) Architecture
• File System
• Database Support
• Network Connectivity
• Security and Permissions
• Programming Languages support
• Development requirements
3
2.1 Hardware
• Android is not a single piece of hardware; it's a complete, end-to-end
software platform that can be adapted to work on any number of
hardware configurations. Everything is there, from the boot loader to all
the way up to the applications.
2.2 Android Architecture
4
Ref: http://developer.android.com/guide/basics/what-is-android.html
2.2.1 Linux Kernel
• Android runs on Linux (version 2.6).
• Linux provides :
– Hardware abstraction layer
– Memory management
– Process management
– Networking
• Users never see Linux sub system
• The adb shell command opens Linux shell
5
2.2.2 Libraries
• Bionic, a super fast and small GPL-based standard C system library (libc)
optimized for embedded Linux-based devices
• Surface Manager for composing window manager with off-screen buffering 2D
and 3D graphics hardware support or software simulation
• Media codecs offer support for major audio/video codecs
• SQLite database
• WebKit library for fast HTML rendering
6
2.2.3 Android Runtime
Dalvik :
• Dalvik VM is Google’s implementation of Java
• Optimized for mobile devices
• Key Dalvik differences:
– Register-based versus stack-based VM
– Dalvik runs .dex files
– More efficient and compact implementation
– Different set of Java libraries than SDK
7
2.2.4 Application Framework
• Activity manager controls the life cycle of the app
• Content providers encapsulate data that is shared (e.g. contacts)
• Resource manager manages everything that is not the code
• Location manager figures out the location of the phone (GPS, GSM, WiFi)
• Notification manager keeps track of events such as arriving
messages, appointments etc.
8
2. 3 File System
• The file system has three main mount points.
– One for system,
– one for the apps,
– and one for whatever.
•Each app has its own sandbox easily accessible to it.
No one else can access its data. The sandbox is in
/data/data/package_name/
•SDCard is always there. It’s a good place for
large files, such as movies and music.
Everyone can access it.
9
10
2.4 Database Support
• The Android API contains support for creating and using SQLite databases.
Each database is private to the application that creates it.
• Android ships with the sqlite3 database tool, which enables you to browse
table contents, run SQL commands, and perform other useful functions on
SQLite databases.
• All databases, SQLite and others, are stored on the device in
/data/data/package_name/databases.
2.5 Network Connectivity
• Android supports wireless communications using:
– GSM mobile-phone technology
– 3G
– Edge
– 802.11 Wi-Fi networks
– BlueTooth
• HTTP : Android has org.apache.http package that has the core interfaces
and classes of the HTTP components.
• HTTPS & SSL: Android provides javax.net.ssl package that has all the
classes and interfaces needed to implement and program the Secure
Socket abstraction based on the SSL protocol SSSLv3.0 or TLSv1.2.
• XML : Most of Java's XML-related APIs are fully supported on Android.
Java's Simple API for XML (SAX) and the Document Object Model (DOM)
are both available on Android.
16
Ref: http://developer.android.com/reference/org/apache/http/package-summary.html
http://developer.android.com/reference/javax/net/ssl/package-summary.html
http://www.ibm.com/developerworks/opensource/library/x-android/index.html
2.6 Security and Permissions (1)
Security Architecture:
• A central design point of the Android security architecture is that no
application, by default, has permission to perform any operations that
would adversely impact other applications, the operating system, or the
user.
• An application's process is a secure sandbox. It can't disrupt other
applications.
• The permissions required by an application are declared statically in that
application, so they can be known up-front at install time and will not
change after that.
17
Ref: http://developer.android.com/guide/topics/security/security.html
13
2.6 Security and Permissions (2)
a. Process level security
b. User & File level security
c. Using Permissions
2.6 Security and Permissions (3)
a. Process level security:
• Each Android application
runs inside its own Linux
process.
• Additionally, each application
has its own sandbox file
system with its own set of
preferences and its own
database.
• Other applications cannot
access any of its data,
unless it is explicitly shared.
14
15
Ref: http://developer.android.com/guide/topics/security/security.html
2.6 Security and Permissions (4)
b. User and File level security :
• Each Android package (.apk) file installed on the device is given its own unique
Linux user ID, creating a sandbox for it and preventing it from touching other
applications (or other applications from touching it).
• This user ID is assigned to it when the application is installed on the
device, and remains constant for the duration of its life on that device.
• Security enforcement happens at the process level, the code of any two
packages can not normally run in the same process, since they need to run as
different Linux users.
• Any data stored by an application will be assigned to that application's user
ID, and not normally accessible to other packages.
• The file created by your application is owned by your application, but its global
read and/or write permissions have been set appropriately so any other
application can see it.
16
Ref: http://developer.android.com/guide/topics/security/security.html
2.6 Security and Permissions (5)
c. Using Permissions:
• A basic Android application has no permissions associated with it.
• To make use of protected features of the device, you must include in your
AndroidManifest.xml one or more <uses-permission> tags declaring the
permissions that your application needs.
• For example, an application that needs to monitor incoming SMS
messages would specify:
• <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.app.myapp" >
<uses-permission android:name="android.permission.RECEIVE_SMS" />
</manifest>
17
2.7 Programming Languages support
• Java – officially supported
• C/C++ – also possible but not supported
18
2.8 Development requirements
• Java
• Android SDK
• Eclipse ID
19
3. IDE and Tools
• Android SDK
• Eclipse IDE + Android Development Tools (ADT) plug in
• Other IDEs
• Tools for debugging, compiling and packaging
3. 1 Android SDK
• Overview of how to get started with the Android SDK:
– make sure that development computer meets the hardware and software requirements
for the Android SDK.
– install the JDK (version 5 or 6 required) and Eclipse (version 3.4 or 3.5, needed only if
you want to develop using the ADT Plugin)
– Download and install the SDK starter package
– Install the Android Development Tool (ADT) Plugin for Eclipse
– Add Android platforms (Android 1.6 or Android 2.0) and other components to your SDK
25
Ref: http://developer.android.com/sdk/index.html
21
3.2 Other IDEs
• Android Applications can be developed in other IDEs such as :
– IntelliJ
– a basic editor such as Emacs
• The recommended way to develop an Android application is to use Eclipse
with the ADT plugin. The ADT plugin provides
editing, building, debugging, and .apk packaging and signing functionality
integrated right into the IDE.
• When developing in IDEs or editors other than Eclipse, you'll require
familiarity with the following Android SDK tools:
– android To create/update Android projects and to create/move/delete AVDs.
– Android Emulator To run your Android applications on an emulated Android platform.
– Android Debug Bridge To interface with your emulator or connected device (install
apps, shell the device, issue commands, etc.).
22
3.3 Other tools
Other Open source and third-party tools :
• Ant - To compile and build your Android project into an installable .apk
file.
• Keytool - To generate a keystore and private key, used to sign your .apk
file.
• Jarsigner (or similar signing tool) - To sign your .apk file with a private key
generated by keytool
– Note: The SDK includes all the tools you need to set up an Android project, build
it, debug it and then package it for distribution.
23
4. Applications Development Walkthrough
• Developing Applications on an Emulator
• Singing your application
• Versioning your application
• Preparing to publish your application
• Publish your App on Android Market
• Sample Applications
24
4.1 Developing Applications on an Emulator
1. Setting up Environment for Development
2. Create Android Virtual Device (AVD)
3. Creating and running a sample App Walkthrough
4.2 Create Android Virtual Device(AVD)
• An AVD defines the system image and device settings used by the
emulator.
• Command : android create avd --target 2 --name my_avd
25
4.3 Creating and running a sample App Walkthrough
32
http://developer.android.com/guide/tutorials/hello-world.html
27
4.4 Publish your App on Android Market
• Android Market is a hosted service that makes it easy for
– Android Users to find and download Android applications
– Android Developers to publish their applications
• To publish your application on Android Market you:
– first need to register with the service using your Google account
– must agree to the terms of service
• To register as an Android Market developer visit
– http://market.android.com/publish
• Requirements enforced by the Android Market server:
– application must be signed with a cryptographic private key whose validity period ends
after 22 October 2033.
– Application must define version code, version name, icon and label attributes in
manifest

Weitere ähnliche Inhalte

Ă„hnlich wie 3. Android Architecture.pptx

CNIT 128 Ch 4: Android
CNIT 128 Ch 4: AndroidCNIT 128 Ch 4: Android
CNIT 128 Ch 4: AndroidSam Bowne
 
My androidpresentation
My androidpresentationMy androidpresentation
My androidpresentationniteshnarayanlal
 
Developing for Android-Types of Android Application
Developing for Android-Types of Android ApplicationDeveloping for Android-Types of Android Application
Developing for Android-Types of Android ApplicationNandini Prabhu
 
Android Programming
Android ProgrammingAndroid Programming
Android ProgrammingPasi Manninen
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_authlzongren
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to androidsrinivasansoundar
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to androidsrinivasansoundar
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to androidsrinivasansoundar
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to androidkrishnastudent88
 
Lecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick OverviewLecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick OverviewAhsanul Karim
 
Android Part-1 - Hello Android
Android Part-1 - Hello AndroidAndroid Part-1 - Hello Android
Android Part-1 - Hello AndroidBipin Jethwani
 
Presentation for Android OS
Presentation for Android OSPresentation for Android OS
Presentation for Android OSMukul Cool
 
Vijay android ppt
Vijay android pptVijay android ppt
Vijay android pptvijaymashre
 
Android Seminar BY Suleman Khan.pdf
Android Seminar BY Suleman Khan.pdfAndroid Seminar BY Suleman Khan.pdf
Android Seminar BY Suleman Khan.pdfNomanKhan869872
 

Ă„hnlich wie 3. Android Architecture.pptx (20)

CNIT 128 Ch 4: Android
CNIT 128 Ch 4: AndroidCNIT 128 Ch 4: Android
CNIT 128 Ch 4: Android
 
My androidpresentation
My androidpresentationMy androidpresentation
My androidpresentation
 
Developing for Android-Types of Android Application
Developing for Android-Types of Android ApplicationDeveloping for Android-Types of Android Application
Developing for Android-Types of Android Application
 
Android Programming
Android ProgrammingAndroid Programming
Android Programming
 
Android report.
Android report.Android report.
Android report.
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Notes Unit2.pptx
Notes Unit2.pptxNotes Unit2.pptx
Notes Unit2.pptx
 
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
Introduction to androidIntroduction to android
Introduction to android
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Android
AndroidAndroid
Android
 
Lecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick OverviewLecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick Overview
 
Android Part-1 - Hello Android
Android Part-1 - Hello AndroidAndroid Part-1 - Hello Android
Android Part-1 - Hello Android
 
Android
AndroidAndroid
Android
 
Presentation for Android OS
Presentation for Android OSPresentation for Android OS
Presentation for Android OS
 
Android
AndroidAndroid
Android
 
Vijay android ppt
Vijay android pptVijay android ppt
Vijay android ppt
 
Android Seminar BY Suleman Khan.pdf
Android Seminar BY Suleman Khan.pdfAndroid Seminar BY Suleman Khan.pdf
Android Seminar BY Suleman Khan.pdf
 
Android ppt
Android ppt Android ppt
Android ppt
 

KĂĽrzlich hochgeladen

How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfWilly Marroquin (WillyDevNET)
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 

KĂĽrzlich hochgeladen (20)

How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 

3. Android Architecture.pptx

  • 2. 2 2. Platform • Hardware • Operating System (Android) Architecture • File System • Database Support • Network Connectivity • Security and Permissions • Programming Languages support • Development requirements
  • 3. 3 2.1 Hardware • Android is not a single piece of hardware; it's a complete, end-to-end software platform that can be adapted to work on any number of hardware configurations. Everything is there, from the boot loader to all the way up to the applications.
  • 4. 2.2 Android Architecture 4 Ref: http://developer.android.com/guide/basics/what-is-android.html
  • 5. 2.2.1 Linux Kernel • Android runs on Linux (version 2.6). • Linux provides : – Hardware abstraction layer – Memory management – Process management – Networking • Users never see Linux sub system • The adb shell command opens Linux shell 5
  • 6. 2.2.2 Libraries • Bionic, a super fast and small GPL-based standard C system library (libc) optimized for embedded Linux-based devices • Surface Manager for composing window manager with off-screen buffering 2D and 3D graphics hardware support or software simulation • Media codecs offer support for major audio/video codecs • SQLite database • WebKit library for fast HTML rendering 6
  • 7. 2.2.3 Android Runtime Dalvik : • Dalvik VM is Google’s implementation of Java • Optimized for mobile devices • Key Dalvik differences: – Register-based versus stack-based VM – Dalvik runs .dex files – More efficient and compact implementation – Different set of Java libraries than SDK 7
  • 8. 2.2.4 Application Framework • Activity manager controls the life cycle of the app • Content providers encapsulate data that is shared (e.g. contacts) • Resource manager manages everything that is not the code • Location manager figures out the location of the phone (GPS, GSM, WiFi) • Notification manager keeps track of events such as arriving messages, appointments etc. 8
  • 9. 2. 3 File System • The file system has three main mount points. – One for system, – one for the apps, – and one for whatever. •Each app has its own sandbox easily accessible to it. No one else can access its data. The sandbox is in /data/data/package_name/ •SDCard is always there. It’s a good place for large files, such as movies and music. Everyone can access it. 9
  • 10. 10 2.4 Database Support • The Android API contains support for creating and using SQLite databases. Each database is private to the application that creates it. • Android ships with the sqlite3 database tool, which enables you to browse table contents, run SQL commands, and perform other useful functions on SQLite databases. • All databases, SQLite and others, are stored on the device in /data/data/package_name/databases.
  • 11. 2.5 Network Connectivity • Android supports wireless communications using: – GSM mobile-phone technology – 3G – Edge – 802.11 Wi-Fi networks – BlueTooth • HTTP : Android has org.apache.http package that has the core interfaces and classes of the HTTP components. • HTTPS & SSL: Android provides javax.net.ssl package that has all the classes and interfaces needed to implement and program the Secure Socket abstraction based on the SSL protocol SSSLv3.0 or TLSv1.2. • XML : Most of Java's XML-related APIs are fully supported on Android. Java's Simple API for XML (SAX) and the Document Object Model (DOM) are both available on Android. 16 Ref: http://developer.android.com/reference/org/apache/http/package-summary.html http://developer.android.com/reference/javax/net/ssl/package-summary.html http://www.ibm.com/developerworks/opensource/library/x-android/index.html
  • 12. 2.6 Security and Permissions (1) Security Architecture: • A central design point of the Android security architecture is that no application, by default, has permission to perform any operations that would adversely impact other applications, the operating system, or the user. • An application's process is a secure sandbox. It can't disrupt other applications. • The permissions required by an application are declared statically in that application, so they can be known up-front at install time and will not change after that. 17 Ref: http://developer.android.com/guide/topics/security/security.html
  • 13. 13 2.6 Security and Permissions (2) a. Process level security b. User & File level security c. Using Permissions
  • 14. 2.6 Security and Permissions (3) a. Process level security: • Each Android application runs inside its own Linux process. • Additionally, each application has its own sandbox file system with its own set of preferences and its own database. • Other applications cannot access any of its data, unless it is explicitly shared. 14
  • 15. 15 Ref: http://developer.android.com/guide/topics/security/security.html 2.6 Security and Permissions (4) b. User and File level security : • Each Android package (.apk) file installed on the device is given its own unique Linux user ID, creating a sandbox for it and preventing it from touching other applications (or other applications from touching it). • This user ID is assigned to it when the application is installed on the device, and remains constant for the duration of its life on that device. • Security enforcement happens at the process level, the code of any two packages can not normally run in the same process, since they need to run as different Linux users. • Any data stored by an application will be assigned to that application's user ID, and not normally accessible to other packages. • The file created by your application is owned by your application, but its global read and/or write permissions have been set appropriately so any other application can see it.
  • 16. 16 Ref: http://developer.android.com/guide/topics/security/security.html 2.6 Security and Permissions (5) c. Using Permissions: • A basic Android application has no permissions associated with it. • To make use of protected features of the device, you must include in your AndroidManifest.xml one or more <uses-permission> tags declaring the permissions that your application needs. • For example, an application that needs to monitor incoming SMS messages would specify: • <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.app.myapp" > <uses-permission android:name="android.permission.RECEIVE_SMS" /> </manifest>
  • 17. 17 2.7 Programming Languages support • Java – officially supported • C/C++ – also possible but not supported
  • 18. 18 2.8 Development requirements • Java • Android SDK • Eclipse ID
  • 19. 19 3. IDE and Tools • Android SDK • Eclipse IDE + Android Development Tools (ADT) plug in • Other IDEs • Tools for debugging, compiling and packaging
  • 20. 3. 1 Android SDK • Overview of how to get started with the Android SDK: – make sure that development computer meets the hardware and software requirements for the Android SDK. – install the JDK (version 5 or 6 required) and Eclipse (version 3.4 or 3.5, needed only if you want to develop using the ADT Plugin) – Download and install the SDK starter package – Install the Android Development Tool (ADT) Plugin for Eclipse – Add Android platforms (Android 1.6 or Android 2.0) and other components to your SDK 25 Ref: http://developer.android.com/sdk/index.html
  • 21. 21 3.2 Other IDEs • Android Applications can be developed in other IDEs such as : – IntelliJ – a basic editor such as Emacs • The recommended way to develop an Android application is to use Eclipse with the ADT plugin. The ADT plugin provides editing, building, debugging, and .apk packaging and signing functionality integrated right into the IDE. • When developing in IDEs or editors other than Eclipse, you'll require familiarity with the following Android SDK tools: – android To create/update Android projects and to create/move/delete AVDs. – Android Emulator To run your Android applications on an emulated Android platform. – Android Debug Bridge To interface with your emulator or connected device (install apps, shell the device, issue commands, etc.).
  • 22. 22 3.3 Other tools Other Open source and third-party tools : • Ant - To compile and build your Android project into an installable .apk file. • Keytool - To generate a keystore and private key, used to sign your .apk file. • Jarsigner (or similar signing tool) - To sign your .apk file with a private key generated by keytool – Note: The SDK includes all the tools you need to set up an Android project, build it, debug it and then package it for distribution.
  • 23. 23 4. Applications Development Walkthrough • Developing Applications on an Emulator • Singing your application • Versioning your application • Preparing to publish your application • Publish your App on Android Market • Sample Applications
  • 24. 24 4.1 Developing Applications on an Emulator 1. Setting up Environment for Development 2. Create Android Virtual Device (AVD) 3. Creating and running a sample App Walkthrough
  • 25. 4.2 Create Android Virtual Device(AVD) • An AVD defines the system image and device settings used by the emulator. • Command : android create avd --target 2 --name my_avd 25
  • 26. 4.3 Creating and running a sample App Walkthrough 32 http://developer.android.com/guide/tutorials/hello-world.html
  • 27. 27 4.4 Publish your App on Android Market • Android Market is a hosted service that makes it easy for – Android Users to find and download Android applications – Android Developers to publish their applications • To publish your application on Android Market you: – first need to register with the service using your Google account – must agree to the terms of service • To register as an Android Market developer visit – http://market.android.com/publish • Requirements enforced by the Android Market server: – application must be signed with a cryptographic private key whose validity period ends after 22 October 2033. – Application must define version code, version name, icon and label attributes in manifest