SlideShare ist ein Scribd-Unternehmen logo
1 von 42
Downloaden Sie, um offline zu lesen
Android developing & OAuth
by Zongren Liu
lzongren@gmail.com
Let's frist begin with
• What is Andorid?
• Update History
• Main Products
• System Structure
• Android dev
What is Android?
• A mobile operating system initially developed by Android
Inc.
• Purchased by Google in 2005.
• Based upon a modified version of the Linux kernel.
• A participant in the Open Handset Alliance(OHA).
• Unit sales for Android OS smartphones ranked first among
all smartphone OS handsets sold in the U.S. in the second
quarter of 2010, at 33%.
(OHA is a business alliance firms for developing open
standards for mobile devices, include Google, HTC, Dell, Intel,
Motorola and so on)
Update history
April 30 2009
1.5 (Cupcake)Based
on Linux Kernel 2.6.27
September 15
2009
1.6 (Donut)Based on
Linux Kernel 2.6.29
October 26 2009
2.0/2.1 (Eclair)Based
on Linux Kernel 2.6.29
May 20 2010
2.2 (Froyo)Based on
Linux Kernel 2.6.32
Scheduled for Q4
2010 launch
GingerbreadBased on
Linux Kernel 2.6.33 or .
34Scheduled for Q4
2010 launch
Android OS usage share
Data collected during two weeks ending on
October 1, 2010
Other: 0.1% of devices running obsolete versions
Main products
Phone:
• HTC Magic
• Nexus One
• Lenovo LePhone
• Motorola Droid Milestone
• Sony Ericsson X10
Internet terminal(Web TV):
• Sony WebTV Internet
Terminal INT-W250
Tablet:
• Archos 7
Archos 7 8GB Home Tablet with
Android (Black)
$189.95
System structure
System structure
——Linux kernel
Android is based on Linux kernel, but is not
Linux/GNU.
GNU/Linux includes:
Cairo 、 X11 、 Alsa 、 FFmpeg 、 GTK 、 Pango 、 Glibc
In Android:
o bionic replaces Glibc
o skia replaces Cairo
o opencore replaces FFmpeg
    
System structure
——Libraries
• System C library - a BSD-derived implementation of the standard C system library (libc),
tuned for embedded Linux-based devices
• Media Libraries - based on PacketVideo's OpenCORE; the libraries support playback
and recording of many popular audio and video formats, as well as static image files,
including MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG
• Surface Manager - manages access to the display subsystem and seamlessly
composites 2D and 3D graphic layers from multiple applications
• LibWebCore - a modern web browser engine which powers both the Android browser and
an embeddable web view
• SGL - the underlying 2D graphics engine
• 3D libraries - an implementation based on OpenGL ES 1.0 APIs; the libraries use either
hardware 3D acceleration (where available) or the included, highly optimized 3D software
rasterizer
• FreeType - bitmap and vector font rendering
• SQLite - a powerful and lightweight relational database engine available to all applications
System structure
——Runtime
Android Runtime:
• Core Libraries
• Dalvik Virtual
Machine
Dalvik Virtual Machine(DVM)
Dalvik is the virtual Machine on Android.Before
execution, Android applications are converted into the
compact .dex format.
JVM ? DVM
Dalvik virtual
Machine
Java virtual
Machine
File Type dex jar 、 jad
Based register heap & stack
Needs
machine
instuructions are
larger
needs more
insturctions
Introduce to developing
• Developing
environment
• Essential tools
• Project structure
• "Hello Android"
• Android Development
Flow
• Important concepts
Developing environment
• Developing In Eclipse, with ADT——recommended
• It gives you access to other Android development tools from inside the
Eclipse IDE. For example, ADT lets you access the many capabilities of the
DDMS tool: take screenshots, manage port-forwarding, set breakpoints,
and view thread and process information directly from Eclipse.
• It provides a New Project Wizard, which helps you quickly create and set
up all of the basic files you'll need for a new Android application.
• It automates and simplifies the process of building your Android application.
• It provides an Android code editor that helps you write valid XML for your
Android manifest and resource files.
• It will even export your project into a signed APK, which can be distributed
to users.
• Developing In Other IDEs
Developing with ADT, you need:
Essential tools:
• Android SDK
there are SDKs for three
platforms(Windows, Linux, MAC
OS)
• ADT Plugin for Eclipse
need to install the plugin in
Eclipse(must be 3.4 or 3.5)
• Virtual Machine
with the tool AVD Manager in
SDK package, you can install the
Virtual Machine
The structure of Android project
Once you complete the New Project Wizard, ADT creates the following folders and files in your
new project:
• src/
Includes your stub Activity Java file. All other Java files for your application go here.
• <Android Version>/ (e.g., Android 1.1/)
Includes the android.jar file that your application will build against. This is determined by
the build target that you have chosen in the New Project Wizard.
• gen/
Ccontains the Java files generated by ADT, such as your R.java file and interfaces
created from AIDL files.(R.java is auto created, should not be modified manually)
• assets/
Empty. You can use it to store raw asset files.
• res/
A folder for your application resources, such as drawable files, layout files, string
values, etc.
• AndroidManifest.xml
The Android Manifest for your project. See The AndroidManifest.xml File.
• default.properties
Contains project settings, such as the build target. This files is integral to the project, as
such,it should be maintained in a Source Revision Control system. It should never be edited
manually.
For example
Files you can edit or modify:
• src - source files
• res - the layout files and
values file
• AndroidManifest.xml
Files you can never modify:
• R.java - resource
file(auto change when
.xml changes)
• default.properties - can
be edit through project
property
"Hello Android"
package com.hello;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class SayHello extends Activity {
/** Called when the activity is first
created. */
@Override
public void onCreate(Bundle
savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView myTextView =
(TextView)findViewById(R.id.myTextView);
myTextView.setText("Hello Android");
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.co
m/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<TextView
android:id="@+id/myTextView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
SayHello.java main.xml
The result
From "Hello Android", we know:
In Android development,
• the xml files in layout folder controls the UI
(in addition, AndroidManifest.xml controls
the UI too)
• the source code controls the program
running
• source code use the items in UI through the
R.java, it is auto created
Android
Develop
-ment
Flow
Important concepts in Android dev
——Activity
From Android dev reference:
An activity is a single, focused thing that the user can do.
Almost all activities interact with the user, so the Activity class
takes care of creating a window for you in which you can place
your UI with setContentView(View). While activities are often
presented to the user as full-screen windows, they can also be
used in other ways: as floating windows (via a theme with
windowIsFloating set) or embedded inside of another activity
(using ActivityGroup).
The Activity class is an important part of an application's
overall lifecycle, and the way activities are launched and put
together is a fundamental part of the platform's application
model.
Activity
Lifecycle
Important concepts in Android dev
——Intent
From Android dev reference:
An intent is an abstract description of an operation to be
performed. It can be used with startActivity to launch an
Activity, broadcastIntent to send it to any interested
BroadcastReceiver components, and startService(Intent) or
bindService(Intent, ServiceConnection, int) to communicate
with a background Service.
An Intent provides a facility for performing late runtime
binding between the code in different applications. Its most
significant use is in the launching of activities, where it can be
thought of as the glue between activities.
Android is not only Android
OAuth
Open Authorization
What is OAuth
• open standard for
authorization;
• allows users to share their
private resources (e.g.
photos, videos) stored on
one site with another site
without having to hand out
their credentials(e.g. ID,
PSW);
• a service that is
complementary to, but
distinct from, OpenID;
OAuth and OpenID
OAuth is not an OpenID extension and at the
specification level, shares only few things with OpenID –
some common authors and the fact both are open
specification in the realm of authentication and access
control. ‘Why OAuth is not an OpenID extension?’ is probably
the most frequently asked question in the group. The answer
is simple, OAuth attempts to provide a standard way for
developers to offer their services via an api without forcing
their users to expose their passwords (and other credentials).
If OAuth depended on OpenID, only OpenID services would
be able to use it, and while OpenID is great, there are many
applications where it is not suitable or desired. Which doesn’t
mean to say you cannot use the two together. OAuth talks
about getting users to grant access while OpenID talks about
making sure the users are really who they say they are.
Protocol Workflow
Example——background
Jane is back from her Scotland
vacation. She spent 2 weeks on
the island of Islay sampling Scotch.
When she gets back home, Jane
wants to share some of her
vacation photos with her friends.
Jane uses Faji, a photo sharing
site, for sharing journey photos.
She signs into her faji.com
account, and uploads two photos
which she marks private.
Example——step1
Jane wants to also share them
with her grandmother. She doesn’t
want to share her rare bottle of
Scotch with anyone. But grandma
doesn’t have an internet
connection so Jane plans to order
prints and have them mailed to
grandma. Being a responsible
person, Jane uses Beppa, an
environmentally friendly photo
printing service.
Using OAuth terminology, Jane is the User
and Faji the Service Provider. The 2 photos
Jane uploaded are the Protected Resources.
Example——step2
Jane visits beppa.com and
begins to order prints.
Beppa supports importing
images from many photo
sharing sites, including
Faji. Jane selects the
photos source and clicks
Continue.
Example——step3
Example——step3
Example——step4
While Jane waits, Beppa uses the
authorized Request Token and
exchanges it for an Access Token.
Request Tokens are only good for
obtaining User approval, while
Access Tokens are used to access
Protected Resources, in this case
Jane’s photos. In the first request,
Beppa exchanges the Request
Token for an Access Token and in
the second (can be multiple
requests, one for a list of photos,
and a few more to get each photo)
request gets the photos.
Example——step4
faji.com
beppa.com
Example——last step
Is OAuth 2.0 Bad for the Web?
One of the most visible utilization of OAuth is Twitter which
decided to make it mandatory across its APIs as of this month
(September 2010) and consequently killed its support for basic
authentication.
Michael Calore explains:Twitter’s move mirrors a broader
trend on the social web, where basic authentication is being
ditched for the more secure OAuth when services and
applications connect user’s accounts.
Many web sites, such as iCodeBlog, provided tutorials to
help developers quickly update their application. And, even
though OAuth 2.0 is still a draft, it is already supported by
Facebook which is to date the largest implementation of the
OAuth protocol and a key stakeholder of the specification.
Is OAuth 2.0 Bad for the Web?
It looks that for once the industry has developed a broad
consensus to solve an important problem.
Yet, Eran Hammer-Lahav, published some criticisms about
the latest direction of the specification which dropped
signatures and cryptography in favor of "bearer tokens".
However, to Eran's own admission,"Cryptography is
unforgiving". Developers can easily make mistakes in the
steps they take to encrypt or sign a message and it is
generally unforgiving.
Is OAuth 2.0 Bad for the Web?
The argument of the supporters of this model is as follows: since most
services use a cookie-based authentication system, it would not be more
secure to use additional mechanisms since an attacker would always
target the weakest point.
Actually, Eran's concerns are not about OAuth today, but the impact
that this specification will have in five years when inherently more secure
protocol will be needed.
• First, the argument will again be, since OAuth 2.0 is the weakest
point, there is no need to implement stronger security mechanisms.
• Second, the reason why OAuth would work in today's environment is
because all the APIs are fairly significant to the clients and most of
the API endpoints are declared statically in the clients code or
configuration while being thoroughly tested before the application is
released.
• So overall, there is little risk that the token will be sent to an
unfriendly destination.
Is OAuth 2.0 Bad for the Web?
"If a client application sends a request to an
erroneous address ("mail.exmple.org" instead of
"mail.example.org"), the rogue server at
"mail.exmple.com" now has the client access
token and can access its mail. Of course, in the
case of browsers, the browser developer is
responsible for not leaking cookies by
implementing the same origin policy. OAuth 2.0
client developers will share the same
responsibility."
Subbu Allamaraju, author of the RESTful Web Services
Cookbook, explained in a private note that:
Thank you :D
lzongren@gmail.com

Weitere ähnliche Inhalte

Was ist angesagt?

Java Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development WorkshopJava Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development WorkshopKasun Dananjaya Delgolla
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android DevelopmentCan Elmas
 
Android fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginnersAndroid fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginnersBoom Shukla
 
android-tutorial-for-beginner
android-tutorial-for-beginnerandroid-tutorial-for-beginner
android-tutorial-for-beginnerAjailal Parackal
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions newJoe Jacob
 
What’s new in aNdroid [Google I/O Extended Bangkok 2016]
What’s new in aNdroid [Google I/O Extended Bangkok 2016]What’s new in aNdroid [Google I/O Extended Bangkok 2016]
What’s new in aNdroid [Google I/O Extended Bangkok 2016]Sittiphol Phanvilai
 
Android 101 - Introduction to Android Development
Android 101 - Introduction to Android DevelopmentAndroid 101 - Introduction to Android Development
Android 101 - Introduction to Android DevelopmentAndy Scherzinger
 
Android Programming Basic
Android Programming BasicAndroid Programming Basic
Android Programming BasicDuy Do Phan
 
9780134433646 annuzzi ch02 (1)
9780134433646 annuzzi ch02 (1)9780134433646 annuzzi ch02 (1)
9780134433646 annuzzi ch02 (1)Peter Mburu
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android DevelopmentSander Alberink
 
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 and its feature
Android and its featureAndroid and its feature
Android and its featureShubham Kumar
 
Basic of Android App Development
Basic of Android App DevelopmentBasic of Android App Development
Basic of Android App DevelopmentAbhijeet Gupta
 

Was ist angesagt? (20)

Java Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development WorkshopJava Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development Workshop
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Android fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginnersAndroid fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginners
 
Android Development Tutorial V3
Android Development Tutorial   V3Android Development Tutorial   V3
Android Development Tutorial V3
 
Android Programming
Android ProgrammingAndroid Programming
Android Programming
 
android-tutorial-for-beginner
android-tutorial-for-beginnerandroid-tutorial-for-beginner
android-tutorial-for-beginner
 
Android Presentation
Android PresentationAndroid Presentation
Android Presentation
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
What’s new in aNdroid [Google I/O Extended Bangkok 2016]
What’s new in aNdroid [Google I/O Extended Bangkok 2016]What’s new in aNdroid [Google I/O Extended Bangkok 2016]
What’s new in aNdroid [Google I/O Extended Bangkok 2016]
 
Android 101 - Introduction to Android Development
Android 101 - Introduction to Android DevelopmentAndroid 101 - Introduction to Android Development
Android 101 - Introduction to Android Development
 
Android Programming Basic
Android Programming BasicAndroid Programming Basic
Android Programming Basic
 
9780134433646 annuzzi ch02 (1)
9780134433646 annuzzi ch02 (1)9780134433646 annuzzi ch02 (1)
9780134433646 annuzzi ch02 (1)
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Android
Android Android
Android
 
Android Basic
Android BasicAndroid Basic
Android Basic
 
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 and its feature
Android and its featureAndroid and its feature
Android and its feature
 
Basic of Android App Development
Basic of Android App DevelopmentBasic of Android App Development
Basic of Android App Development
 

Ähnlich wie Android dev o_auth

Seminar on android app development
Seminar on android app developmentSeminar on android app development
Seminar on android app developmentAbhishekKumar4779
 
Android Application Development Training by NITIN GUPTA
Android Application Development Training by NITIN GUPTA Android Application Development Training by NITIN GUPTA
Android Application Development Training by NITIN GUPTA NITIN GUPTA
 
Android Seminar BY Suleman Khan.pdf
Android Seminar BY Suleman Khan.pdfAndroid Seminar BY Suleman Khan.pdf
Android Seminar BY Suleman Khan.pdfNomanKhan869872
 
From Containerization to Modularity
From Containerization to ModularityFrom Containerization to Modularity
From Containerization to Modularityoasisfeng
 
Introduction to android mobile app development.pptx
Introduction to android mobile app development.pptxIntroduction to android mobile app development.pptx
Introduction to android mobile app development.pptxridzah12
 
Introduction to android app development
Introduction to android app developmentIntroduction to android app development
Introduction to android app developmentcncwebworld
 
Androidoverview 100405150711-phpapp01
Androidoverview 100405150711-phpapp01Androidoverview 100405150711-phpapp01
Androidoverview 100405150711-phpapp01Santosh Sh
 
Phonebook Directory or Address Book In Android
Phonebook Directory or Address Book In AndroidPhonebook Directory or Address Book In Android
Phonebook Directory or Address Book In AndroidABHISHEK DINKAR
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to androidzeelpatel0504
 

Ähnlich wie Android dev o_auth (20)

Android
AndroidAndroid
Android
 
01 03 - introduction to android
01  03 - introduction to android01  03 - introduction to android
01 03 - introduction to android
 
Seminar on android app development
Seminar on android app developmentSeminar on android app development
Seminar on android app development
 
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
 
Intro to android (gdays)
Intro to android (gdays)Intro to android (gdays)
Intro to android (gdays)
 
PPT Companion to Android
PPT Companion to AndroidPPT Companion to Android
PPT Companion to Android
 
Android Application Development Training by NITIN GUPTA
Android Application Development Training by NITIN GUPTA Android Application Development Training by NITIN GUPTA
Android Application Development Training by NITIN GUPTA
 
Android Seminar BY Suleman Khan.pdf
Android Seminar BY Suleman Khan.pdfAndroid Seminar BY Suleman Khan.pdf
Android Seminar BY Suleman Khan.pdf
 
Android Applications
Android ApplicationsAndroid Applications
Android Applications
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Android ppt
Android ppt Android ppt
Android ppt
 
My androidpresentation
My androidpresentationMy androidpresentation
My androidpresentation
 
From Containerization to Modularity
From Containerization to ModularityFrom Containerization to Modularity
From Containerization to Modularity
 
Introduction to android mobile app development.pptx
Introduction to android mobile app development.pptxIntroduction to android mobile app development.pptx
Introduction to android mobile app development.pptx
 
Introduction to android app development
Introduction to android app developmentIntroduction to android app development
Introduction to android app development
 
Androidoverview 100405150711-phpapp01
Androidoverview 100405150711-phpapp01Androidoverview 100405150711-phpapp01
Androidoverview 100405150711-phpapp01
 
Phonebook Directory or Address Book In Android
Phonebook Directory or Address Book In AndroidPhonebook Directory or Address Book In Android
Phonebook Directory or Address Book In Android
 
Android class provider in mumbai
Android class provider in mumbaiAndroid class provider in mumbai
Android class provider in mumbai
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 

Kürzlich hochgeladen

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Kürzlich hochgeladen (20)

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

Android dev o_auth

  • 1. Android developing & OAuth by Zongren Liu lzongren@gmail.com
  • 2. Let's frist begin with • What is Andorid? • Update History • Main Products • System Structure • Android dev
  • 3. What is Android? • A mobile operating system initially developed by Android Inc. • Purchased by Google in 2005. • Based upon a modified version of the Linux kernel. • A participant in the Open Handset Alliance(OHA). • Unit sales for Android OS smartphones ranked first among all smartphone OS handsets sold in the U.S. in the second quarter of 2010, at 33%. (OHA is a business alliance firms for developing open standards for mobile devices, include Google, HTC, Dell, Intel, Motorola and so on)
  • 4. Update history April 30 2009 1.5 (Cupcake)Based on Linux Kernel 2.6.27 September 15 2009 1.6 (Donut)Based on Linux Kernel 2.6.29 October 26 2009 2.0/2.1 (Eclair)Based on Linux Kernel 2.6.29 May 20 2010 2.2 (Froyo)Based on Linux Kernel 2.6.32 Scheduled for Q4 2010 launch GingerbreadBased on Linux Kernel 2.6.33 or . 34Scheduled for Q4 2010 launch
  • 5. Android OS usage share Data collected during two weeks ending on October 1, 2010 Other: 0.1% of devices running obsolete versions
  • 6. Main products Phone: • HTC Magic • Nexus One • Lenovo LePhone • Motorola Droid Milestone • Sony Ericsson X10 Internet terminal(Web TV): • Sony WebTV Internet Terminal INT-W250 Tablet: • Archos 7 Archos 7 8GB Home Tablet with Android (Black) $189.95
  • 8. System structure ——Linux kernel Android is based on Linux kernel, but is not Linux/GNU. GNU/Linux includes: Cairo 、 X11 、 Alsa 、 FFmpeg 、 GTK 、 Pango 、 Glibc In Android: o bionic replaces Glibc o skia replaces Cairo o opencore replaces FFmpeg     
  • 9. System structure ——Libraries • System C library - a BSD-derived implementation of the standard C system library (libc), tuned for embedded Linux-based devices • Media Libraries - based on PacketVideo's OpenCORE; the libraries support playback and recording of many popular audio and video formats, as well as static image files, including MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG • Surface Manager - manages access to the display subsystem and seamlessly composites 2D and 3D graphic layers from multiple applications • LibWebCore - a modern web browser engine which powers both the Android browser and an embeddable web view • SGL - the underlying 2D graphics engine • 3D libraries - an implementation based on OpenGL ES 1.0 APIs; the libraries use either hardware 3D acceleration (where available) or the included, highly optimized 3D software rasterizer • FreeType - bitmap and vector font rendering • SQLite - a powerful and lightweight relational database engine available to all applications
  • 10. System structure ——Runtime Android Runtime: • Core Libraries • Dalvik Virtual Machine Dalvik Virtual Machine(DVM) Dalvik is the virtual Machine on Android.Before execution, Android applications are converted into the compact .dex format.
  • 11. JVM ? DVM Dalvik virtual Machine Java virtual Machine File Type dex jar 、 jad Based register heap & stack Needs machine instuructions are larger needs more insturctions
  • 12. Introduce to developing • Developing environment • Essential tools • Project structure • "Hello Android" • Android Development Flow • Important concepts
  • 13. Developing environment • Developing In Eclipse, with ADT——recommended • It gives you access to other Android development tools from inside the Eclipse IDE. For example, ADT lets you access the many capabilities of the DDMS tool: take screenshots, manage port-forwarding, set breakpoints, and view thread and process information directly from Eclipse. • It provides a New Project Wizard, which helps you quickly create and set up all of the basic files you'll need for a new Android application. • It automates and simplifies the process of building your Android application. • It provides an Android code editor that helps you write valid XML for your Android manifest and resource files. • It will even export your project into a signed APK, which can be distributed to users. • Developing In Other IDEs
  • 14.
  • 15. Developing with ADT, you need: Essential tools: • Android SDK there are SDKs for three platforms(Windows, Linux, MAC OS) • ADT Plugin for Eclipse need to install the plugin in Eclipse(must be 3.4 or 3.5) • Virtual Machine with the tool AVD Manager in SDK package, you can install the Virtual Machine
  • 16. The structure of Android project Once you complete the New Project Wizard, ADT creates the following folders and files in your new project: • src/ Includes your stub Activity Java file. All other Java files for your application go here. • <Android Version>/ (e.g., Android 1.1/) Includes the android.jar file that your application will build against. This is determined by the build target that you have chosen in the New Project Wizard. • gen/ Ccontains the Java files generated by ADT, such as your R.java file and interfaces created from AIDL files.(R.java is auto created, should not be modified manually) • assets/ Empty. You can use it to store raw asset files. • res/ A folder for your application resources, such as drawable files, layout files, string values, etc. • AndroidManifest.xml The Android Manifest for your project. See The AndroidManifest.xml File. • default.properties Contains project settings, such as the build target. This files is integral to the project, as such,it should be maintained in a Source Revision Control system. It should never be edited manually.
  • 17. For example Files you can edit or modify: • src - source files • res - the layout files and values file • AndroidManifest.xml Files you can never modify: • R.java - resource file(auto change when .xml changes) • default.properties - can be edit through project property
  • 18. "Hello Android" package com.hello; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class SayHello extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); TextView myTextView = (TextView)findViewById(R.id.myTextView); myTextView.setText("Hello Android"); } } <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.co m/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> <TextView android:id="@+id/myTextView" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </LinearLayout> SayHello.java main.xml
  • 20. From "Hello Android", we know: In Android development, • the xml files in layout folder controls the UI (in addition, AndroidManifest.xml controls the UI too) • the source code controls the program running • source code use the items in UI through the R.java, it is auto created
  • 22. Important concepts in Android dev ——Activity From Android dev reference: An activity is a single, focused thing that the user can do. Almost all activities interact with the user, so the Activity class takes care of creating a window for you in which you can place your UI with setContentView(View). While activities are often presented to the user as full-screen windows, they can also be used in other ways: as floating windows (via a theme with windowIsFloating set) or embedded inside of another activity (using ActivityGroup). The Activity class is an important part of an application's overall lifecycle, and the way activities are launched and put together is a fundamental part of the platform's application model.
  • 24. Important concepts in Android dev ——Intent From Android dev reference: An intent is an abstract description of an operation to be performed. It can be used with startActivity to launch an Activity, broadcastIntent to send it to any interested BroadcastReceiver components, and startService(Intent) or bindService(Intent, ServiceConnection, int) to communicate with a background Service. An Intent provides a facility for performing late runtime binding between the code in different applications. Its most significant use is in the launching of activities, where it can be thought of as the glue between activities.
  • 25. Android is not only Android
  • 27. What is OAuth • open standard for authorization; • allows users to share their private resources (e.g. photos, videos) stored on one site with another site without having to hand out their credentials(e.g. ID, PSW); • a service that is complementary to, but distinct from, OpenID;
  • 28. OAuth and OpenID OAuth is not an OpenID extension and at the specification level, shares only few things with OpenID – some common authors and the fact both are open specification in the realm of authentication and access control. ‘Why OAuth is not an OpenID extension?’ is probably the most frequently asked question in the group. The answer is simple, OAuth attempts to provide a standard way for developers to offer their services via an api without forcing their users to expose their passwords (and other credentials). If OAuth depended on OpenID, only OpenID services would be able to use it, and while OpenID is great, there are many applications where it is not suitable or desired. Which doesn’t mean to say you cannot use the two together. OAuth talks about getting users to grant access while OpenID talks about making sure the users are really who they say they are.
  • 30. Example——background Jane is back from her Scotland vacation. She spent 2 weeks on the island of Islay sampling Scotch. When she gets back home, Jane wants to share some of her vacation photos with her friends. Jane uses Faji, a photo sharing site, for sharing journey photos. She signs into her faji.com account, and uploads two photos which she marks private.
  • 31. Example——step1 Jane wants to also share them with her grandmother. She doesn’t want to share her rare bottle of Scotch with anyone. But grandma doesn’t have an internet connection so Jane plans to order prints and have them mailed to grandma. Being a responsible person, Jane uses Beppa, an environmentally friendly photo printing service. Using OAuth terminology, Jane is the User and Faji the Service Provider. The 2 photos Jane uploaded are the Protected Resources.
  • 32. Example——step2 Jane visits beppa.com and begins to order prints. Beppa supports importing images from many photo sharing sites, including Faji. Jane selects the photos source and clicks Continue.
  • 35. Example——step4 While Jane waits, Beppa uses the authorized Request Token and exchanges it for an Access Token. Request Tokens are only good for obtaining User approval, while Access Tokens are used to access Protected Resources, in this case Jane’s photos. In the first request, Beppa exchanges the Request Token for an Access Token and in the second (can be multiple requests, one for a list of photos, and a few more to get each photo) request gets the photos.
  • 38. Is OAuth 2.0 Bad for the Web? One of the most visible utilization of OAuth is Twitter which decided to make it mandatory across its APIs as of this month (September 2010) and consequently killed its support for basic authentication. Michael Calore explains:Twitter’s move mirrors a broader trend on the social web, where basic authentication is being ditched for the more secure OAuth when services and applications connect user’s accounts. Many web sites, such as iCodeBlog, provided tutorials to help developers quickly update their application. And, even though OAuth 2.0 is still a draft, it is already supported by Facebook which is to date the largest implementation of the OAuth protocol and a key stakeholder of the specification.
  • 39. Is OAuth 2.0 Bad for the Web? It looks that for once the industry has developed a broad consensus to solve an important problem. Yet, Eran Hammer-Lahav, published some criticisms about the latest direction of the specification which dropped signatures and cryptography in favor of "bearer tokens". However, to Eran's own admission,"Cryptography is unforgiving". Developers can easily make mistakes in the steps they take to encrypt or sign a message and it is generally unforgiving.
  • 40. Is OAuth 2.0 Bad for the Web? The argument of the supporters of this model is as follows: since most services use a cookie-based authentication system, it would not be more secure to use additional mechanisms since an attacker would always target the weakest point. Actually, Eran's concerns are not about OAuth today, but the impact that this specification will have in five years when inherently more secure protocol will be needed. • First, the argument will again be, since OAuth 2.0 is the weakest point, there is no need to implement stronger security mechanisms. • Second, the reason why OAuth would work in today's environment is because all the APIs are fairly significant to the clients and most of the API endpoints are declared statically in the clients code or configuration while being thoroughly tested before the application is released. • So overall, there is little risk that the token will be sent to an unfriendly destination.
  • 41. Is OAuth 2.0 Bad for the Web? "If a client application sends a request to an erroneous address ("mail.exmple.org" instead of "mail.example.org"), the rogue server at "mail.exmple.com" now has the client access token and can access its mail. Of course, in the case of browsers, the browser developer is responsible for not leaking cookies by implementing the same origin policy. OAuth 2.0 client developers will share the same responsibility." Subbu Allamaraju, author of the RESTful Web Services Cookbook, explained in a private note that: