• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Holland9 Android Workshop Hogeschool Rotterdam
 

Holland9 Android Workshop Hogeschool Rotterdam

on

  • 4,587 views

Slides used at Holland9 Android Workshop Hogeschool Rotterdam.

Slides used at Holland9 Android Workshop Hogeschool Rotterdam.

Statistics

Views

Total Views
4,587
Views on SlideShare
4,147
Embed Views
440

Actions

Likes
0
Downloads
0
Comments
0

2 Embeds 440

http://confluence.cmi-hro.nl 423
http://www.slideshare.net 17

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

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
  • -
  • Recommended hardware requirementsGoogle apps (gmail, market, youtube) closed sourceGoogle libraries (maps) not part of Android core
  • An “app” is a package of 4 types of components.Activity, Service, Content Provider, Broadcast ReceiverA package can have 0 .. n “launchable” ActivitiesActivity in package A can call Activity in package BContent Provider identified by URL, accessed like databaseIntent starts one Activity, Broadcast can start multiple receiversCreate your own permissions which other apps must request
  • XML is a struggle at firstXML makes code less britleProgrammatic UI composing is possibleComplete widget setCustom WidgetsEvents: Click, Input, Focus, SelectionList and ExpandableListSpecialized ActivitiesMenu XML definitionToast is an auto-dismissing dialogExternalized values leaves cleaner codeEasy localization all in 1 appDrawing onto Canvas with PaintOpenGL 3DAnimations by frames or (scriptable) tweens
  • XML is a struggle at firstXML makes code less britleProgrammatic UI composing is possibleComplete widget setCustom WidgetsEvents: Click, Input, Focus, SelectionList and ExpandableListSpecialized ActivitiesMenu XML definitionToast is an auto-dismissing dialogExternalized values leaves cleaner codeEasy localization all in 1 appDrawing onto Canvas with PaintOpenGL 3DAnimations by frames or (scriptable) tweens
  • XML is a struggle at firstXML makes code less britleProgrammatic UI composing is possibleComplete widget setCustom WidgetsEvents: Click, Input, Focus, SelectionList and ExpandableListSpecialized ActivitiesMenu XML definitionToast is an auto-dismissing dialogExternalized values leaves cleaner codeEasy localization all in 1 appDrawing onto Canvas with PaintOpenGL 3DAnimations by frames or (scriptable) tweens
  • XML is a struggle at firstXML makes code less britleProgrammatic UI composing is possibleComplete widget setCustom WidgetsEvents: Click, Input, Focus, SelectionList and ExpandableListSpecialized ActivitiesMenu XML definitionToast is an auto-dismissing dialogExternalized values leaves cleaner codeEasy localization all in 1 appDrawing onto Canvas with PaintOpenGL 3DAnimations by frames or (scriptable) tweens
  • XML is a struggle at firstXML makes code less britleProgrammatic UI composing is possibleComplete widget setCustom WidgetsEvents: Click, Input, Focus, SelectionList and ExpandableListSpecialized ActivitiesMenu XML definitionToast is an auto-dismissing dialogExternalized values leaves cleaner codeEasy localization all in 1 appDrawing onto Canvas with PaintOpenGL 3DAnimations by frames or (scriptable) tweens
  • XML is a struggle at firstXML makes code less britleProgrammatic UI composing is possibleComplete widget setCustom WidgetsEvents: Click, Input, Focus, SelectionList and ExpandableListSpecialized ActivitiesMenu XML definitionToast is an auto-dismissing dialogExternalized values leaves cleaner codeEasy localization all in 1 appDrawing onto Canvas with PaintOpenGL 3DAnimations by frames or (scriptable) tweens
  • SQLite full fledged DBCursorsCursor AdaptersAdapter ViewsShareable through content provider to ensure consitencyResources (read only)Array valuesAssetsPackaged Data filesPreferencesEasy storage of settingsPreference screensXml definitionFilesRead/Write whateverRequires permission
  • SQLite full fledged DBCursorsCursor AdaptersAdapter ViewsShareable through content provider to ensure consitencyResources (read only)Array valuesAssetsPackaged Data filesPreferencesEasy storage of settingsPreference screensXml definitionFilesRead/Write whateverRequires permission
  • SQLite full fledged DBCursorsCursor AdaptersAdapter ViewsShareable through content provider to ensure consitencyResources (read only)Array valuesAssetsPackaged Data filesPreferencesEasy storage of settingsPreference screensXml definitionFilesRead/Write whateverRequires permission
  • SQLite full fledged DBCursorsCursor AdaptersAdapter ViewsShareable through content provider to ensure consitencyResources (read only)Array valuesAssetsPackaged Data filesPreferencesEasy storage of settingsPreference screensXml definitionFilesRead/Write whateverRequires permission

Holland9 Android Workshop Hogeschool Rotterdam Holland9 Android Workshop Hogeschool Rotterdam Presentation Transcript

  • WorkshopAndroid
    Presented by
    Arno den Hond
    Jorik Bremer
    Holland9.com
  • Introduction
    Android in one afternoon
    Understanding Android technology and being Eric Schmidt
    Arno den Hond: Android technical developer
    Jorik Bremer: Android business consultant
    Holland9.com
  • Workshop Outline
    13.00 - 13.15: Android introduction
    History, facts and trends
    13.15 - 13.35: Android Atonomy
    Introduction into GUI framework
    13.35 - 14.15: Doing Android Part 1
    Making app with dialer, GPS and browser
    10 MINUTE BREAK
    14.25 – 15.45: Doing Android Part 2
    Making app with dialer, GPS and browser
    10 MINUTE BREAK
    15.55 - 16.30: The future of Android
    Android Business Case
    Holland9.com
  • Android Introduction
    Holland9.com
  • Google why Android?
    Carrier Adoptation but…
    It’s free everybody …
    Targeting
    Security
    Distribution channels
    Holland9.com
  • Some facts and figures
    Open Handset Alliance
    Markets and devices
    Developers ecosystem
    Holland9.com
  • Android Anatomy
    What is Android? (and what not?)
    Is it Java? Difference with iPhone?
    Component Mash-up
    Activity, Content Provider, Broadcast, Service
    User Interface
    XML, Layout, Widgets
    • Data Storage
    • SQLite, XML, Preferences Framework
    • Location and Maps
    Holland9.com
  • What is Android
    • Not hardware but a software platform
    • Java syntax but different compiler and virtual machine
    • Android Library and Google Libraries
    • NDK
    • Open source platform, closed source apps
    Holland9.com
  • Component Mash-Up
    • UI Component: Activity
    • Intents to start Activities
    • ContentProviders to expose data
    • BroadcastReceivers to receive messages
    • Services in the background
    • Permissions
    • APK resources
    Holland9.com
  • User Interface
    • Activity Lifecycle
    • XML Definition
    • Screen Layouts
    • Widget Components
    • Event Listeners
    • Pop-up Menu
    • Externalized values
    • Localization
    • Themes
    • Graphics
    • Animations
    Holland9.com
  • XML Definition
    • Activity Lifecycle
    • XML Definition
    • Screen Layouts
    • Widget Components
    • Event Listeners
    • Pop-up Menu
    • Externalized values
    • Localization
    • Themes
    • Graphics
    • Animations
    Mark-up style definition
    Separates code from design
    Eclipse designer
    Device customization
    Holland9.com
  • Screen Layouts
    • Activity Lifecycle
    • XML Definition
    • Screen Layouts
    • Widget Components
    • Event Listeners
    • Pop-up Menu
    • Externalized values
    • Localization
    • Themes
    • Graphics
    • Animations
    FrameLayout
    LinearLayout
    TableLayout
    RelativeLayout
    ScrollView
    Holland9.com
  • Widget Components
    • Activity Lifecycle
    • XML Definition
    • Screen Layouts
    • Widget Components
    • Event Listeners
    • Pop-up Menu
    • Externalized values
    • Localization
    • Themes
    • Graphics
    • Animations
    Buttons
    Options
    Input
    Lists
    Custom Views
    Holland9.com
  • Intent
    • Matching
    • Urls
    • Broadcasts
    Holland9.com
  • Notifications
    • Dialog
    • Toast
    • Notification Manager
    • Alarm Manager
    Holland9.com
  • Data Storage
    • SQLite
    • Resources
    • Assets
    • Preferences
    • Files
    • Adapter Views
    Holland9.com
  • Location and Maps
    • Location Providers
    • Network, Wifi, GPS
    • Criteria
    • Power, Accuracy, Cost
    • Location methods
    • Bearing, distance
    • Google Maps Api
    • Api Key
    • Overlays
    • Push pins
    Holland9.com
  • Webview
    • View component
    • Link destination
    • Javascript interaction
    Holland9.com
  • Peripherals
    • Camera/ Display
    • Tilt / Accelerometer
    • Magnetic compass
    • GPS
    • Microphone / Speaker
    • Keyboard
    • Trackball / D-Pad
    • 3G / Wi-Fi / Bluetooth
    Holland9.com
  • Summary
    • Components
    • Activities & Intents
    • User Interface
    • Notifications
    • Data Storage
    • Location
    • Map
    • WebView
    Holland9.com
  • Hands on
    • Eclipse ADT
    • Emulator
    • Create Activity
    • Create Button
    • Start Intent
    • Use Location Manager
    • Show MapView
    Holland9.com
  • ADT & Emulator
    • Help > Install new software (3.5 Galileo)
    • Help > Software updates (3.4 Ganymede)
    • SDK / AVD manager
    • Create new virtual device with Google API
    • Start device
    • http://developer.android.com/sdk/eclipse-adt.html
    Holland9.com
  • Create Activity
    • File > New > Other > Android Project
    • Define Project, App, Package, Activity Name
    • Build Target: Google APIs
    • Run “Hello World” in emulator.
    • http://developer.android.com/resources/tutorials/hello-world.html
    Holland9.com
  • Create Button Layout
    • Open root eslayoutmain.xml
    • Select LinearLayout in Outline view.
    • In Properties view set Orientation field to “vertical”.
    • Add Button widget to LinearLayout
    • In Properties view set Id to “@+id/mybutton”
    • Verify generated XML in “main.xml” tab page
    • Open rootsrcmypackagemyactivity.java
    • http://developer.android.com/resources/tutorials/views/index.html
    Holland9.com
  • Create Button Listener
    • In onCreate Method, after setContentView, get a pointer to the Button
    • Button mybutton = (Button) findViewById(R.id.mybutton);
    • Add click listener to button using its setOnClickListener() method.
    • Add OnClickListener interface to Activity.
    • Add unimplemented onClick(View v) method.
    • http://developer.android.com/guide/topics/ui/ui-events.html
    Holland9.com
  • Start Intent
    • In onClick method, create a new Intent object.
    • String action = Intent.ACTION_DIAL
    • Uri uri = Uri.parse(“tel:1234567890”)
    • In onClick method, call startActivity(myIntent);
    • Run in emulator
    • Try Intent.ACTION_VIEW and “http://server”
    • http://developer.android.com/guide/topics/intents/intents-filters.html
    Holland9.com
  • Create your own Intent
    • Create another Activity sub-class.
    • Open rootAndroidManifest.xml
    • Within the application tag, create an activity tag. Set the android:name attribute to the new Activity class. Nest an intent-filter tag. Nest an action tag (attribute name to whatever) and a category tag (attribute name to android.intent.category.DEFAULT)
    • In onClick method, call the whatever action without an Uri.
    Holland9.com
  • LocationManager
    • In manifest.xml, add 2 permissions.
    • Within the manifest tag, create 2 uses-permission tag. Set the android:name attributes to android.permission.ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION.
    • In Activity’s onCreate method, get a pointer to LocationManager using getSystemService Method with Context.LOCATION_SERVICE parameter. Cast result to LocationManager.
    Holland9.com
  • Criteria and Location
    • Create a criteria object and setAccuracy to Criteria.ACCURACY_FINE
    • Get a location provider by calling the LocationManager’sgetBestProvider method with the criteria parameter and a boolean to return only enabled providers.
    • Use LocationManagersgetLastKnownLocation method with the provider parameter to get a Location object.
    Holland9.com
  • Displaying the location
    • Similar to the buttons, now add 2 TextView widgets to the layout. Name them @+id/latitude and @+id/longitude
    • Using findViewById, get pointers to the TextViews.
    • Use Location’s getLatitude and getLongitude methods to get values.
    • Use TextView’ssetText method to set values into UI.
    Holland9.com
  • Manipulating the Emulator
    • Connect telnet client to localhost on port 5554
    • Use command “geo fix 5 52” to set location.
    • Longitude (angle from Greenwich meridian) first, then latitude (angle from Equator)
    • Negative values for western and southern hemisphere.
    • Create a button and listener to refresh the UI
    • http://developer.android.com/guide/developing/tools/emulator.html
    Holland9.com
  • MapView UI
    • Create a new “Android XML file”
    • Select type Layout and root element FrameLayout.
    • ADT does not support MapView so add it manually to XML:
    <com.google.android.maps.MapView
    android:id=“@+id/mapview”
    android:layout_width=“fill_parent”
    android:layout_height=“fill_parent”
    android:clickable=“true”/>
    Holland9.com
  • Certificate Fingerprint and Maps Key
    • Locate your debug keystore in Eclipse configuration
    • From command prompt, at keystore location use “keytool -list -alias androiddebugkey -keystoredebug.keystore” to get fingerprint.
    • Passwords: android
    • http://code.google.com/android/maps-api-signup.html
    • Add android:apiKey=“mykey” attribute to MapView tag in layout xml.
    Holland9.com
  • Preparing the map
    • Add a uses-library tag inside the application tag. Set tag attribute android:name to com.google.android.maps
    • Add a uses-permission tag inside the manifest tag. Set tag attribute android:name to android.permission.INTERNET
    • Create a subclass of MapActivity and set the layout containing the mapview like before.
    • Get a pointer to the mapview as before and call setBuiltInZoomControls(true)
    Holland9.com
  • Creating the overlay
    • Create a class to extend ItemizedOverlay
    • createItem(inti) method returns a GeoPoint wrapped in an OverlayItem.
    • Call the Overlay’s populate method after updating the Item
    • Add your ItemizedOverlay subclass to the MapView’s overlays.
    • http://developer.android.com/resources/tutorials/views/hello-mapview.html
    Holland9.com
  • Testing / Debugging
    • Try to run it in the emulator.
    • In system settings, turn on a location provider
    • Add a refresh button and see the marker move after manipulating the location.
    • Use Logcat view to show debug info.
    • http://developer.android.com/guide/index.html
    Holland9.com
  • Being Eric Schmidt
    • Now you decide ……..
    Holland9.com