intro to android development n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Intro to Android Development PowerPoint Presentation
Download Presentation
Intro to Android Development

Loading in 2 Seconds...

play fullscreen
1 / 47

Intro to Android Development - PowerPoint PPT Presentation


  • 131 Views
  • Uploaded on

Intro to Android Development. 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/.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Intro to Android Development' - ewa


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
getting started
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.
download albie aimv1
Download Albie (AIMv1).
  • First, make sure that your Eclipse Java ADT is installed and running correctly.
    • File -> New -> 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 --> Import...
    • Expand Android folder.
    • Select 'Existing Android Code Into Workspace.'
    • Next.
download albie continued
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-#.'"
download albie continued1
Download Albie (continued).
  • Start with a fresh build by doing the following:
    • Select AIMv1 in Package Explorer.
    • Project -> Clean
    • Run -> Run As -> Android Application
  • Ignore any and all directories/folders with CVS in the name.
slide6

ac·tiv·i·ty [ak-tiv-i-tee]

  • noun, plural ac·tiv·i·ties.
  • 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/activity
definition activity
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
definition activity1
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. (That’s fancy! I’m working on using op. cit.)
definition activity2
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.
layouts
Layouts
  • AbsoluteLayout
  • DrawerLayout
  • FrameLayout
  • GridLayout
  • GridView
  • LinearLayout
  • ListView
  • RelativeLayout
  • SlidingPaneLayout
  • WebView
xml extensible markup language
xml – extensible markup language

prolog

Example:

<?xml version="1.0" encoding="ISO-8859-1"?>

<shiporder orderid="889923"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:noNamespaceSchemaLocation="shiporder.xsd">

<orderperson>John Smith</orderperson>

<shipto name="Ola Nordmann"

address="Langgt 23"

city="4000 Stavanger"

country="Norway“ />

<item>

<title>Empire Burlesque</title>

<note>Special Edition</note>

<quantity>1</quantity>

<price>10.90</price>

</item>

<item>

<title>Hide your heart</title>

<quantity>1</quantity>

<price>9.90</price>

</item>

</shiporder>

xml extensible markup language1
xml – extensible markup language

start tag

end tag

Example:

<?xml version="1.0" encoding="ISO-8859-1"?>

<shiporder orderid="889923"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:noNamespaceSchemaLocation="shiporder.xsd">

<orderperson>John Smith</orderperson>

<shipto name="Ola Nordmann"

address="Langgt 23"

city="4000 Stavanger"

country="Norway“ />

<item>

<title>Empire Burlesque</title>

<note>Special Edition</note>

<quantity>1</quantity>

<price>10.90</price>

</item>

<item>

<title>Hide your heart</title>

<quantity>1</quantity>

<price>9.90</price>

</item>

</shiporder>

xml extensible markup language2
xml – extensible markup language

tags w/ contents:

item tag has contents.

title, note, quantity, and price tags also have contents.

Example:

<?xml version="1.0" encoding="ISO-8859-1"?>

<shiporder orderid="889923"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:noNamespaceSchemaLocation="shiporder.xsd">

<orderperson>John Smith</orderperson>

<shipto name="Ola Nordmann"

address="Langgt 23"

city="4000 Stavanger"

country="Norway“ />

<item>

<title>Empire Burlesque</title>

<note>Special Edition</note>

<quantity>1</quantity>

<price>10.90</price>

</item>

<item>

<title>Hide your heart</title>

<quantity>1</quantity>

<price>9.90</price>

</item>

</shiporder>

xml extensible markup language3
xml – extensible markup language

empty tag (no end tag).

Example:

<?xml version="1.0" encoding="ISO-8859-1"?>

<shiporder orderid="889923"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:noNamespaceSchemaLocation="shiporder.xsd">

<orderperson>John Smith</orderperson>

<shipto name="Ola Nordmann"

address="Langgt 23"

city="4000 Stavanger"

country="Norway“ />

<item>

<title>Empire Burlesque</title>

<note>Special Edition</note>

<quantity>1</quantity>

<price>10.90</price>

</item>

<item>

<title>Hide your heart</title>

<quantity>1</quantity>

<price>9.90</price>

</item>

</shiporder>

xml extensible markup language4
xml – extensible markup language

attribute name

attribute value

Example:

<?xml version="1.0" encoding="ISO-8859-1"?>

<shiporder orderid="889923"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:noNamespaceSchemaLocation="shiporder.xsd">

<orderperson>John Smith</orderperson>

<shipto name="Ola Nordmann"

address="Langgt 23"

city="4000 Stavanger"

country="Norway“ />

<item>

<title>Empire Burlesque</title>

<note>Special Edition</note>

<quantity>1</quantity>

<price>10.90</price>

</item>

<item>

<title>Hide your heart</title>

<quantity>1</quantity>

<price>9.90</price>

</item>

</shiporder>

xml extensible markup language5
xml – extensible markup language

Example:

<?xml version="1.0" encoding="ISO-8859-1"?>

<shiporder orderid="889923"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:noNamespaceSchemaLocation="shiporder.xsd">

<orderperson>John Smith</orderperson>

<shipto name="Ola Nordmann"

address="Langgt 23"

city="4000 Stavanger"

country="Norway“ />

<item>

<title>Empire Burlesque</title>

<note>Special Edition</note>

<quantity>1</quantity>

<price>10.90</price>

</item>

<item>

<title>Hide your heart</title>

<quantity>1</quantity>

<price>9.90</price>

</item>

</shiporder>

Note: The shiporder tag has both attributes and contents.

setup on pc
Setup on PC
  • Install eclipse + android (see http://developer.android.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.
setup on pc1
Setup on PC

Two ways to run Android apps:

  • Create a virtual device.
    • Note: It takes some time for the emulator to start. So don’t close it once it starts! (Use the ‘back’ button to stop you application.)
  • Use a real android device. BEST!
setup on pc for galaxy
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.
steps to run your android application
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.)
setup on android device
Setup on Android device
  • Setting --> Security --> Unknown source
    • Make sure it’s checked.
  • Settings --> Developer options --> USB debugging
    • Make sure it’s checked.
comments about layouts
Comments about layouts
  • Layouts may be nested/hierarchical.
  • See http://www.learn-android.com/2010/01/05/android-layout-tutorial/ for a layout tutorial.
writing to the log
Writing to the log

import android.util.Log;…

Log.v( "andy1", "MainActivity.sendMessage: hello" );

d – debug

e – error

i – information

v – verbose

w – warning

android widget classes
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
summary
Summary
  • Activity
    • http://developer.android.com/reference/android/app/Activity.html
  • Intent
    • http://developer.android.com/reference/android/content/Intent.html
references
References
  • developer.android.com/guide/topics/ui/declaring-layout.html
  • developer.android.com/guide/topics/ui/layout/linear.html; developer.android.com/reference/android/widget/LinearLayout.html
  • developer.android.com/guide/topics/ui/layout/relative.html; developer.android.com/reference/android/widget/RelativeLayout.html
  • developer.android.com/guide/webapps/webview.html; developer.android.com/reference/android/webkit/WebView.html
  • developer.android.com/guide/topics/ui/layout/listview.html; http://developer.android.com/reference/android/widget/ListView.html
  • developer.android.com/guide/topics/ui/layout/gridview.html; http://developer.android.com/reference/android/widget/GridView.html
  • http://developer.android.com/tools/debugging/debugging-log.html
  • http://developer.android.com/reference/android/widget/package-summary.html
  • http://www.learn-android.com/2010/01/05/android-layout-tutorial/
how to disable the native android browser not firefox etc from going mobile
How to disable the native Android browser (not Firefox, etc.) from “going mobile.”
  • Open browser
  • Type "about:debug" in the address bar. Press "go.“ Nothing will happen, this will only enable more options in the menu.
  • Go to menu. (Notice ‘Dump V8 counters’ at bottom.)
  • Choose Settings -> Debug -> UAString.
  • Select "desktop."