• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Yourstory Android Workshop
 

Yourstory Android Workshop

on

  • 502 views

 

Statistics

Views

Total Views
502
Views on SlideShare
484
Embed Views
18

Actions

Likes
3
Downloads
11
Comments
0

2 Embeds 18

http://belimitless.co 12
http://127.0.0.1 6

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Yourstory Android Workshop Yourstory Android Workshop Presentation Transcript

    • Agenda ● Introduction ● Android Components overview ● Sample Application ● Android Software Stack ● Android Components detailed – Activity, Service, Provider, Receiver
    • History of Android • Android, Inc. – 2003 • Operating system for digital cameras • Google Acquisition – 2005 • Open Handset Alliance – Nov 2007 –  Google, HTC, Sony and Samsung – Qualcomm and Texas Instruments •  HTC Dream - October 22, 2008
    • Android Application Components
    • Application Components • Application components are the essential building blocks of an Android application.
    • Application components ● Activity ● Service ● Broadcast Receiver ● Content Provider
    • Application components
    • Activities • An activity represents a single screen with a user interface • Example of Activities in Email app – Email List – Compose – Read
    • Activities
    • Services • A service is a component that runs in the background • A service does not provide a user interface. • Example : Music Player, Downloader
    • Services
    • Content Provider • Content provider – Allows to share data with other apps •
    • Content Provider
    • Content Provider
    • Broadcast Receiver ● Listener of System wide events. ● Examples – SMS received , Wifi / Bluetooth connected – Battery Low, Device Rebooted ● No UI ● Lightweight ( < 10 seconds )
    • Intents IntentsIntents Intents are messages across components. Like Hyperlinks on the web
    • Intents ● Support interaction between components – e.g. Start a new Activity – Broadcast messages ● Intents : request for action to be performed
    • 17 Types of Intents MyApp Activity1 Service1Intent ( myService.class ) OtherAppMyApp Activity1 Activity2 Explicit Intent Implicit IntentIntent ( “ACTION” ) Intents
    • Intents start new Activity ● Dial a number Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(“tel:97412345”)); ● Launch a website Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(“http://www.google.com”));
    • Intents start new Activity ● Launch another activity Intent i = new Intent(this, SecondActivity.class) startActivity(i)
    • Intent Filter ● Registers components as capable of receiving Intents ● Matches intents to the component (Activity , Service, Receivers) ● Declared mostly in AndroidManifest.xml
    • Functional Android App
    • <?xml version="1.0" encoding="utf-8"?> <manifest> <uses-permission /> <uses-sdk /> <application> <activity> </activity> </application> </manifest> Application Manifest File
    • <?xml version="1.0" encoding="utf-8"?> <LinearLayout> <TextView android:text="I am a TextView" /> <Button android:text="I am a Button" /> </LinearLayout> XML Snippet
    • Preview
    • Layouts • Linear Layout • Relative Layout • List View • Grid View
    • Linear Layout <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:orientation="vertical" > <TextView android:text="I am a TextView" /> <Button android:text="I am a Button" /> </LinearLayout>
    • Linear Layout <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:orientation=“horizontal" > <TextView android:text="I am a TextView" /> <Button android:text="I am a Button" /> </LinearLayout>
    • Layouts Grid ViewList View
    • UI Widgets
    • Sample App <Button android:id="@+id/my_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=“I am a Button"/> Button myButton =(Button)findViewById(R.id.my_button);
    • Sample App public void (View v) { // action } Add this in XML file android:onClick="myMethod"
    • Sample App ● Extend this to create SecondActivity ● invoked on clicking the button
    • Inside the APK ● Compiled Java source ● Libraries ● XML files for UI, strings ● Resources – Images etc ● Android Manifest
    • Android Software Stack ● Kernel ● Libraries / Runtime ● Application Framework ● Applications
    • Android Software Stack
    • Linux kernel • Android built on Linux 2.6 kernel • Provides security, memory management, process management, network stack, and driver model • Abstraction layer between hardware and the software stack
    • Libraries • A set of C/C++ libraries exposed to developers through the application framework
    • Application Framework
    • Application Framework
    • Applications
    • Summary ● Android Components ● Android Sample Program ● Activity, Services, Broadcast Receiver ● Intents ● Android Stack
    • Contact arvindd@belimitless.co http://belimitless.co