android development, an introduction to development

Upload: victor-miclovich

Post on 08-Apr-2018

241 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 Android Development, an introduction to development

    1/58

    Welcome... to Google IO 11; ooops...sorry,

    GTUG welcomes you to the Android launch

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    2/58

    Location: San Francisco, California

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    3/58

    nah!! just Kidding...

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    4/58

    Google Uganda - Android Developer LaunchKampala, Uganda

    May, 2011

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    5/58

    Victor Miclovich, Android developer + enthusiasttwitter:@vicmiclovich

    An droid A

    w

    eso meness

    Friday, May 6, 2011

    http://cwezi.com/http://storyspaces.org/http://storyspaces.org/http://storyspaces.org/http://storyspaces.org/http://mspoti.com/http://mspoti.com/http://cwezi.com/http://cwezi.com/
  • 8/6/2019 Android Development, an introduction to development

    6/58

    Introducing Android Devices

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    7/58

    Fun and Easy to useCool graphics

    lots of power under the hood for

    gaming

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    8/58

    Key-lessnesslose the key pad... new devices designed to be touch-

    screen compatible; Android takes it a notch higher:

    multitouch

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    9/58

    CommunicationGmail

    And obviously:Web browser,

    Basic BT,etc.

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    10/58

    Online connectivity...

    Android OS is designed to enable device

    connectivity to the networked world

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    11/58

    A-O-B

    Lots of power under the hood >>> in comes Appdevelopment

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    12/58

    Application Development$> Assumptions

    $> Framework $> Piecing the UI together$> Basic networking

    $> Services (RESTful web service intro)

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    13/58

    Assumptions

    Youve read thehandout or have itclose by to guide you...

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    14/58

    About Android }-*->F-work

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    15/58

    What is a mobile app?

    a set of user interfaces arranged to form a pattern

    these patterns tend to accomplish tasks!!!

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    16/58

    How to design an app?

    Start with an idea

    Research the idea (ask around: UCD )

    Concept it (use storyboards, write! write!)

    Prototype it

    Start codingIterate (repeat step 1 or 2)

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    17/58

    Isnt that easy?

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    18/58

    How?????

    ?how?

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    19/58

    Android UIs

    2 ways of working magic with apps-->>

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    20/58

    One way is...

    through a declarative approach...

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    21/58

    Declarative user interface

    Friday, May 6, 2011

    http://schemas.android.com/apk/res/androidhttp://schemas.android.com/apk/res/androidhttp://schemas.android.com/apk/res/androidhttp://schemas.android.com/apk/res/android
  • 8/6/2019 Android Development, an introduction to development

    22/58

    another way is to...

    use a programmatic approach...

    Google advises programmers to choose option 1)why?

    ->It is cleaner + keeps your code easy to maintain->In case you make app changes, it is easy to do

    examples:*swing*gwt

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    23/58

    what to do?

    Youll use both approaches

    Declarative approach to describe how somethinglooks or appears such what a button should look like

    Programmatic approach to give life to the UI

    component such as a button

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    24/58

    user interface design...

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    25/58

    Android UID

    Views

    Layouts

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    26/58

    Views

    Everything you see through your screen is a view

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    27/58

    Examples of Views

    TextView (text)

    ButtonView (buttons)

    ListView (lists)

    EditView (text boxes)

    ImageView (image)

    MapView (to viewmaps)

    WebView (embeddedweb + webkitrendering)

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    28/58

    Layouts

    Organize views

    group view components together

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    29/58

    Examples Layouts

    LinearLayouts

    TableLayouts

    FrameLayout

    RelativeLayout

    AbsoluteLayout (using (x,y) coord. system)

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    30/58

    Notes

    Layouts are resizable (expand with content)expand with the different device sizes (bettergraphics rendering that supports)

    Layouts are customizable

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    31/58

    What else in Android?

    Services that will run in the background

    Intents and broadcasting (that support in-appnotication and instructions)

    lots of crazy cool stuff... just need to dig deeper than45 minutes! lol!

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    32/58

    Prerequisites

    Java programming

    Read the handout

    watch out for things like the application life cycle, etc.

    Ask questions at the end

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    33/58

    Code

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    34/58

    Layout parameters

    Specify the way layouts appear

    Basically in your xml les:

    android:layout_height =

    android:layout_width =

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    35/58

  • 8/6/2019 Android Development, an introduction to development

    36/58

    analogous to a screen

    respond to broadcast intents/ msgs

    tasks that run in the backgroundapps can share data

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    37/58

    Activities

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    38/58

  • 8/6/2019 Android Development, an introduction to development

    39/58

    Intents

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    40/58

    Intents

    Intents help describe what you want done (verb words+ objects)

    Pick photo from album

    Delete music

    Make a call

    Android matches Intent with Activity (object) that canbest provide a service

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    41/58

    NoteActivities and BroadcastReceivers describe what intents

    they can service in their IntentFilters through theAndroidManifest.xml le

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    42/58

    BroadcastReceivers

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    43/58

    BroadcastReceivers

    components designed to respond to Broadcast Intents

    also, apps can create and broadcast their own Intents

    as well.

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    44/58

    Servers

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    45/58

    Services

    These are components that run in the background...

    A music player keeps running even when you chooseto start looking through your gallery

    You can type a message while listening to music

    Download a pdf while browsing Youtubeetc.

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    46/58

    ContentProviders

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    47/58

    ContentProviders

    A ContentProvider enables sharing of data acrossdifferent apps

    some apps can poll the address book an app could use your gallery photos, etc.

    Provides a single unied API for

    CRUD operations

    Content is represented by a URI and MIME type

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    48/58

    Other issues of great importance...

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    49/58

    Persisting data

    Some apps need to cache or store data inside of thephone (email, messages, attachments via bluetooth,etc.)

    Android provides a couple of ways to store your data

    as a at le

    in a database (SQLite)

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    50/58

    Note

    There are lots of useful APIs to interact with thedatabase, le system, etc.

    Android is powerful and quite large

    Look around to see what you can do with it...

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    51/58

    Going forward...

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    52/58

    Packaging

    Android apps are packaged in .apk les

    Everything needed to run your app is found in the apk

    It also includes your application manifest le (wherepermissions for activities and other predened settingsare saved up) {look at handout for more info in app}

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    53/58

    Android denes resources an app uses in the res/ folderres/layout (contains layout rules)

    res/drawable (for drawing)

    res/anim (for animations your app might need)

    res/values (externalized values for strings, colors, styles and lots more)

    res/xml (general xml les that are needed at run time such as a settings.xml le, etc.)

    res/raw (binary les like sound are dened in there)

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    54/58

    Assets

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    55/58

    Assets

    A lot similar to resources (from slides before)

    Any kind of le can be stored (make sure it doesntcomplete the SD card memory or other)

    Differences are:

    assets are read onlyInputStream class (methods) access assets

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    56/58

    The Networked world...

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    57/58

    so much to say...

    Trending way of development

    use an API to expose a service your mobile app canuse

    Your app can persist data in a database if network isunavailable

    Apps are so much fun when connected to theInternet

    Friday, May 6, 2011

  • 8/6/2019 Android Development, an introduction to development

    58/58

    The End...More might come in the future,

    (coming soon)

    vicmiclovich{at}gmail.com

    http://cwezi.com/trainingshttp://cwezi.com/trainings