Intro to Android Development - PowerPoint PPT Presentation

Loading...

PPT – Intro to Android Development PowerPoint presentation | free to download - id: 5fbe8f-YTUyM



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

Intro to Android Development

Description:

Intro to Android Development Setup on Android device Setting -- Security -- Unknown source Make sure it s checked. Settings -- Developer options -- USB ... – PowerPoint PPT presentation

Number of Views:1176
Avg rating:3.0/5.0
Slides: 48
Provided by: GeorgeGre9
Learn more at: http://people.sju.edu
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: Intro to Android Development


1
Intro to Android Development
2
Getting started
  • Install Android SDK (includes Eclipse
    http//developer.android.com/sdk/index.html) .
  • If using Windows eclipse Samsung Galaxy,
    install Galaxy driver.
  • Install Samsung Kies application.
  • Download from http//www.samsung.com/us/kies/.
  • Do not check Unified Driver Installer.
  • No need to install Galaxy drivers when using
    Linux eclipse.

3
Download Albie (AIMv1).
  • First, make sure that your Eclipse Java ADT is
    installed and running correctly.
  • File -gt New -gt Android Application Project.
  • Call it Test and make sure you can build and run
    it.
  • Unzip aimv1.zip but do not unzip it directly into
    the eclipse workspace.
  • The directory, AIMv1, will be created.
  • File --gt Import...
  • Expand Android folder.
  • Select 'Existing Android Code Into Workspace.'
  • Next.

4
Download Albie (continued).
  • Use Browse to find the Root Directory which is
    AIMv1 (unzipped above).
  • Check 'Copy projects into workspace.'
  • Finish.
  • The AIMv1 folder should now appear in the eclipse
    Package Explorer.
  • You may ignore the error message, "Unable to
    resolve target 'android-.'"

5
Download Albie (continued).
  • Start with a fresh build by doing the following
  • Select AIMv1 in Package Explorer.
  • Project -gt Clean
  • Run -gt Run As -gt Android Application
  • Ignore any and all directories/folders with CVS
    in the name.

6
  • activity ak-tiv-i-tee
  • noun, plural activities.
  • the state or quality of being active There was
    not much activity in the stock market today. He
    doesn't have enough physical activity in his
    life.
  • a specific deed, action, function, or sphere of
    action social activities.
  • work, especially in elementary grades at school,
    that involves direct experience by the student
    rather than textbook study.
  • energetic activity animation liveliness.
  • a use of energy or force an active movement or
    operation.
  • from http//dictionary.reference.com/browse/activi
    ty

7
Definition Activity
  • Activity
  • An application usually consists of multiple
    activities that are loosely bound to each other.
  • Typically, one activity in an application is
    specified as the "main" activity, which is
    presented to the user when launching the
    application for the first time.
  • Each activity can then start another activity in
    order to perform different actions.
  • developer.android.com/guide/components/activities.
    html

8
(No Transcript)
9
Definition Activity
  • Activity
  • An Activity is an application component that
    provides a screen with which users can interact
    in order to do something, such as dial the phone,
    take a photo, send an email, or view a map.
  • Each activity is given a window in which to draw
    its user interface.
  • The window typically fills the screen, but may be
    smaller than the screen and float on top of other
    windows.
  • Ibid. (Thats fancy! Im working on using op.
    cit.)

10
Associated with the main activity is an XML file
that describes its UI layout.
11
Definition Activity
  • Activity
  • Each time a new activity starts, the previous
    activity is stopped, but the system preserves the
    activity in a stack (the "back stack").
  • When a new activity starts, it is pushed onto the
    back stack and takes user focus.
  • The back stack abides to the basic "last in,
    first out" stack mechanism, so, when the user is
    done with the current activity and presses the
    Back button, it is popped from the stack (and
    destroyed) and the previous activity resumes.
  • Ibid.

12
These Java files are automatically generated. Do
not edit them!
13
(No Transcript)
14
Layouts
  1. AbsoluteLayout
  2. DrawerLayout
  3. FrameLayout
  4. GridLayout
  5. GridView
  6. LinearLayout
  7. ListView
  8. RelativeLayout
  9. SlidingPaneLayout
  10. WebView

15
xml
16
xml extensible markup language
  • Example
  • lt?xml version"1.0" encoding"ISO-8859-1"?gt
  • ltshiporder orderid"889923"
  • xmlnsxsi"http//www.w3.org/2001/XMLSchema-inst
    ance"
  • xsinoNamespaceSchemaLocation"shiporder.xsd"gt
  • ltorderpersongtJohn Smithlt/orderpersongt
  • ltshipto name"Ola Nordmann"
  • address"Langgt 23"
  • city"4000 Stavanger"
  • country"Norway /gt
  • ltitemgt
  • lttitlegtEmpire Burlesquelt/titlegt
  • ltnotegtSpecial Editionlt/notegt
  • ltquantitygt1lt/quantitygt
  • ltpricegt10.90lt/pricegt
  • lt/itemgt
  • ltitemgt
  • lttitlegtHide your heartlt/titlegt

prolog
17
xml extensible markup language
  • Example
  • lt?xml version"1.0" encoding"ISO-8859-1"?gt
  • ltshiporder orderid"889923"
  • xmlnsxsi"http//www.w3.org/2001/XMLSchema-inst
    ance"
  • xsinoNamespaceSchemaLocation"shiporder.xsd"gt
  • ltorderpersongtJohn Smithlt/orderpersongt
  • ltshipto name"Ola Nordmann"
  • address"Langgt 23"
  • city"4000 Stavanger"
  • country"Norway /gt
  • ltitemgt
  • lttitlegtEmpire Burlesquelt/titlegt
  • ltnotegtSpecial Editionlt/notegt
  • ltquantitygt1lt/quantitygt
  • ltpricegt10.90lt/pricegt
  • lt/itemgt
  • ltitemgt
  • lttitlegtHide your heartlt/titlegt

start tag end tag
18
xml extensible markup language
  • Example
  • lt?xml version"1.0" encoding"ISO-8859-1"?gt
  • ltshiporder orderid"889923"
  • xmlnsxsi"http//www.w3.org/2001/XMLSchema-inst
    ance"
  • xsinoNamespaceSchemaLocation"shiporder.xsd"gt
  • ltorderpersongtJohn Smithlt/orderpersongt
  • ltshipto name"Ola Nordmann"
  • address"Langgt 23"
  • city"4000 Stavanger"
  • country"Norway /gt
  • ltitemgt
  • lttitlegtEmpire Burlesquelt/titlegt
  • ltnotegtSpecial Editionlt/notegt
  • ltquantitygt1lt/quantitygt
  • ltpricegt10.90lt/pricegt
  • lt/itemgt
  • ltitemgt
  • lttitlegtHide your heartlt/titlegt

tags w/ contents item tag has
contents. title, note, quantity, and price tags
also have contents.
19
xml extensible markup language
  • Example
  • lt?xml version"1.0" encoding"ISO-8859-1"?gt
  • ltshiporder orderid"889923"
  • xmlnsxsi"http//www.w3.org/2001/XMLSchema-inst
    ance"
  • xsinoNamespaceSchemaLocation"shiporder.xsd"gt
  • ltorderpersongtJohn Smithlt/orderpersongt
  • ltshipto name"Ola Nordmann"
  • address"Langgt 23"
  • city"4000 Stavanger"
  • country"Norway /gt
  • ltitemgt
  • lttitlegtEmpire Burlesquelt/titlegt
  • ltnotegtSpecial Editionlt/notegt
  • ltquantitygt1lt/quantitygt
  • ltpricegt10.90lt/pricegt
  • lt/itemgt
  • ltitemgt
  • lttitlegtHide your heartlt/titlegt

empty tag (no end tag).
20
xml extensible markup language
  • Example
  • lt?xml version"1.0" encoding"ISO-8859-1"?gt
  • ltshiporder orderid"889923"
  • xmlnsxsi"http//www.w3.org/2001/XMLSchema-inst
    ance"
  • xsinoNamespaceSchemaLocation"shiporder.xsd"gt
  • ltorderpersongtJohn Smithlt/orderpersongt
  • ltshipto name"Ola Nordmann"
  • address"Langgt 23"
  • city"4000 Stavanger"
  • country"Norway /gt
  • ltitemgt
  • lttitlegtEmpire Burlesquelt/titlegt
  • ltnotegtSpecial Editionlt/notegt
  • ltquantitygt1lt/quantitygt
  • ltpricegt10.90lt/pricegt
  • lt/itemgt
  • ltitemgt
  • lttitlegtHide your heartlt/titlegt

attribute name attribute value
21
xml extensible markup language
  • Example
  • lt?xml version"1.0" encoding"ISO-8859-1"?gt
  • ltshiporder orderid"889923"
  • xmlnsxsi"http//www.w3.org/2001/XMLSchema-inst
    ance"
  • xsinoNamespaceSchemaLocation"shiporder.xsd"gt
  • ltorderpersongtJohn Smithlt/orderpersongt
  • ltshipto name"Ola Nordmann"
  • address"Langgt 23"
  • city"4000 Stavanger"
  • country"Norway /gt
  • ltitemgt
  • lttitlegtEmpire Burlesquelt/titlegt
  • ltnotegtSpecial Editionlt/notegt
  • ltquantitygt1lt/quantitygt
  • ltpricegt10.90lt/pricegt
  • lt/itemgt
  • ltitemgt
  • lttitlegtHide your heartlt/titlegt

Note The shiporder tag has both attributes and
contents.
22
(No Transcript)
23
The manifest lists and contains information about
all of the activities in the application.
24
(No Transcript)
25
(No Transcript)
26
Xml and layouts
27
(No Transcript)
28
Setting up the android development environment
29
Setup on PC
  • Install eclipse android (see http//developer.an
    droid.com/sdk/index.html).
  • Instructions are there if eclipse is already
    installed.
  • Enable virtualization in BIOS.
  • On a Lenovo T510, press F1 when you see the
    ThinkVantage message.

30
Setup on PC
  • Two ways to run Android apps
  • Create a virtual device.
  • Note It takes some time for the emulator to
    start. So dont close it once it starts! (Use
    the back button to stop you application.)
  • Use a real android device. BEST!

31
Setup on PC for Galaxy
  • Install the Android USB driver for Samsung.
  • First, install Samsung Kies software.
  • This will take some time (1 hour).
  • Then it will update itself again.
  • Then plug in the Galaxy your laptop will install
    a number of drivers.
  • If all is well, when you run adb devices on your
    laptop, you will see your device listed.

32
Steps to run your Android application
  • Right-click on the name of your project in the
    Project Explorer pane.
  • Choose your Android device (or virtual device).
    (See next slide.)

33
Setup
34
Setup on Android device
  • Setting --gt Security --gt Unknown source
  • Make sure its checked.
  • Settings --gt Developer options --gt USB debugging
  • Make sure its checked.

35
Comments about layouts
  • Layouts may be nested/hierarchical.
  • See http//www.learn-android.com/2010/01/05/androi
    d-layout-tutorial/ for a layout tutorial.

36
How to Log messages for debugging
37
Writing to the log
  • import android.util.Log
  • Log.v( "andy1", "MainActivity.sendMessage hello"
    )

d debug e error i information v verbose w
warning
38
Accessing the log file via eclipse
39
Android widgets
40
Android widget classes
  • More than 100!
  • See http//developer.android.com/reference/android
    /widget/package-summary.html.
  • Button
  • EditText
  • ImageButton
  • ImageView
  • NumberPicker
  • PopupMenu
  • RadioButton, RadioGroup
  • Toast
  • ToggleButton

41
Layout editor
42
Palette contents disappear when Show Previews is
selected (default)
43
(No Transcript)
44
(No Transcript)
45
Summary
  • Activity
  • http//developer.android.com/reference/android/app
    /Activity.html
  • Intent
  • http//developer.android.com/reference/android/con
    tent/Intent.html

46
References
  • developer.android.com/guide/topics/ui/declaring-la
    yout.html
  • developer.android.com/guide/topics/ui/layout/linea
    r.html developer.android.com/reference/android/wi
    dget/LinearLayout.html
  • developer.android.com/guide/topics/ui/layout/relat
    ive.html developer.android.com/reference/android/
    widget/RelativeLayout.html
  • developer.android.com/guide/webapps/webview.html
    developer.android.com/reference/android/webkit/Web
    View.html
  • developer.android.com/guide/topics/ui/layout/listv
    iew.html http//developer.android.com/reference/a
    ndroid/widget/ListView.html
  • developer.android.com/guide/topics/ui/layout/gridv
    iew.html http//developer.android.com/reference/a
    ndroid/widget/GridView.html
  • http//developer.android.com/tools/debugging/debug
    ging-log.html
  • http//developer.android.com/reference/android/wid
    get/package-summary.html
  • http//www.learn-android.com/2010/01/05/android-la
    yout-tutorial/

47
How to disable the native Android browser (not
Firefox, etc.) from going mobile.
  1. Open browser
  2. Type "aboutdebug" in the address bar. Press
    "go. Nothing will happen, this will only enable
    more options in the menu.
  3. Go to menu. (Notice Dump V8 counters at
    bottom.)
  4. Choose Settings -gt Debug -gt UAString.
  5. Select "desktop."
About PowerShow.com