Your SlideShare is downloading. ×
Holland9 Android Workshop Hogeschool Rotterdam
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Holland9 Android Workshop Hogeschool Rotterdam

3,300
views

Published on

Slides used at Holland9 Android Workshop Hogeschool Rotterdam.

Slides used at Holland9 Android Workshop Hogeschool Rotterdam.

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
3,300
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • -
  • 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
  • Transcript

    • 1. WorkshopAndroid
      Presented by
      Arno den Hond
      Jorik Bremer
      Holland9.com
    • 2. 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
    • 3. 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
    • 4. Android Introduction
      Holland9.com
    • 5. Google why Android?
      Carrier Adoptation but…
      It’s free everybody …
      Targeting
      Security
      Distribution channels
      Holland9.com
    • 6. Some facts and figures
      Open Handset Alliance
      Markets and devices
      Developers ecosystem
      Holland9.com
    • 7. 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
      • 8. SQLite, XML, Preferences Framework
      • 9. Location and Maps
      Holland9.com
    • 10. What is Android
      • Not hardware but a software platform
      • 11. Java syntax but different compiler and virtual machine
      • 12. Android Library and Google Libraries
      • 13. NDK
      • 14. Open source platform, closed source apps
      Holland9.com
    • 15. Component Mash-Up
      • UI Component: Activity
      • 16. Intents to start Activities
      • 17. ContentProviders to expose data
      • 18. BroadcastReceivers to receive messages
      • 19. Services in the background
      • 20. Permissions
      • 21. APK resources
      Holland9.com
    • 22. User Interface
      Holland9.com
    • 33. XML Definition
      Mark-up style definition
      Separates code from design
      Eclipse designer
      Device customization
      Holland9.com
    • 44. Screen Layouts
      FrameLayout
      LinearLayout
      TableLayout
      RelativeLayout
      ScrollView
      Holland9.com
    • 55. Widget Components
      Buttons
      Options
      Input
      Lists
      Custom Views
      Holland9.com
    • 66. Intent
      Holland9.com
    • 69. Notifications
      Holland9.com
    • 73. Data Storage
      Holland9.com
    • 79. Location and Maps
      Holland9.com
    • 89. Webview
      • View component
      • 90. Link destination
      • 91. Javascript interaction
      Holland9.com
    • 92. Peripherals
      Holland9.com
    • 100. Summary
      Holland9.com
    • 108. Hands on
      Holland9.com
    • 115. ADT & Emulator
      • Help > Install new software (3.5 Galileo)
      • 116. Help > Software updates (3.4 Ganymede)
      • 117. SDK / AVD manager
      • 118. Create new virtual device with Google API
      • 119. Start device
      • 120. http://developer.android.com/sdk/eclipse-adt.html
      Holland9.com
    • 121. Create Activity
      • File > New > Other > Android Project
      • 122. Define Project, App, Package, Activity Name
      • 123. Build Target: Google APIs
      • 124. Run “Hello World” in emulator.
      • 125. http://developer.android.com/resources/tutorials/hello-world.html
      Holland9.com
    • 126. Create Button Layout
      • Open root eslayoutmain.xml
      • 127. Select LinearLayout in Outline view.
      • 128. In Properties view set Orientation field to “vertical”.
      • 129. Add Button widget to LinearLayout
      • 130. In Properties view set Id to “@+id/mybutton”
      • 131. Verify generated XML in “main.xml” tab page
      • 132. Open rootsrcmypackagemyactivity.java
      • 133. http://developer.android.com/resources/tutorials/views/index.html
      Holland9.com
    • 134. Create Button Listener
      • In onCreate Method, after setContentView, get a pointer to the Button
      • 135. Button mybutton = (Button) findViewById(R.id.mybutton);
      • 136. Add click listener to button using its setOnClickListener() method.
      • 137. Add OnClickListener interface to Activity.
      • 138. Add unimplemented onClick(View v) method.
      • 139. http://developer.android.com/guide/topics/ui/ui-events.html
      Holland9.com
    • 140. Start Intent
      • In onClick method, create a new Intent object.
      • 141. String action = Intent.ACTION_DIAL
      • 142. Uri uri = Uri.parse(“tel:1234567890”)
      • 143. In onClick method, call startActivity(myIntent);
      • 144. Run in emulator
      • 145. Try Intent.ACTION_VIEW and “http://server”
      • 146. http://developer.android.com/guide/topics/intents/intents-filters.html
      Holland9.com
    • 147. Create your own Intent
      • Create another Activity sub-class.
      • 148. Open rootAndroidManifest.xml
      • 149. 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)
      • 150. In onClick method, call the whatever action without an Uri.
      Holland9.com
    • 151. LocationManager
      • In manifest.xml, add 2 permissions.
      • 152. Within the manifest tag, create 2 uses-permission tag. Set the android:name attributes to android.permission.ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION.
      • 153. In Activity’s onCreate method, get a pointer to LocationManager using getSystemService Method with Context.LOCATION_SERVICE parameter. Cast result to LocationManager.
      Holland9.com
    • 154. Criteria and Location
      • Create a criteria object and setAccuracy to Criteria.ACCURACY_FINE
      • 155. Get a location provider by calling the LocationManager’sgetBestProvider method with the criteria parameter and a boolean to return only enabled providers.
      • 156. Use LocationManagersgetLastKnownLocation method with the provider parameter to get a Location object.
      Holland9.com
    • 157. Displaying the location
      • Similar to the buttons, now add 2 TextView widgets to the layout. Name them @+id/latitude and @+id/longitude
      • 158. Using findViewById, get pointers to the TextViews.
      • 159. Use Location’s getLatitude and getLongitude methods to get values.
      • 160. Use TextView’ssetText method to set values into UI.
      Holland9.com
    • 161. Manipulating the Emulator
      • Connect telnet client to localhost on port 5554
      • 162. Use command “geo fix 5 52” to set location.
      • 163. Longitude (angle from Greenwich meridian) first, then latitude (angle from Equator)
      • 164. Negative values for western and southern hemisphere.
      • 165. Create a button and listener to refresh the UI
      • 166. http://developer.android.com/guide/developing/tools/emulator.html
      Holland9.com
    • 167. MapView UI
      • Create a new “Android XML file”
      • 168. Select type Layout and root element FrameLayout.
      • 169. 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
    • 170. Certificate Fingerprint and Maps Key
      • Locate your debug keystore in Eclipse configuration
      • 171. From command prompt, at keystore location use “keytool -list -alias androiddebugkey -keystoredebug.keystore” to get fingerprint.
      • 172. Passwords: android
      • 173. http://code.google.com/android/maps-api-signup.html
      • 174. Add android:apiKey=“mykey” attribute to MapView tag in layout xml.
      Holland9.com
    • 175. Preparing the map
      • Add a uses-library tag inside the application tag. Set tag attribute android:name to com.google.android.maps
      • 176. Add a uses-permission tag inside the manifest tag. Set tag attribute android:name to android.permission.INTERNET
      • 177. Create a subclass of MapActivity and set the layout containing the mapview like before.
      • 178. Get a pointer to the mapview as before and call setBuiltInZoomControls(true)
      Holland9.com
    • 179. Creating the overlay
      • Create a class to extend ItemizedOverlay
      • 180. createItem(inti) method returns a GeoPoint wrapped in an OverlayItem.
      • 181. Call the Overlay’s populate method after updating the Item
      • 182. Add your ItemizedOverlay subclass to the MapView’s overlays.
      • 183. http://developer.android.com/resources/tutorials/views/hello-mapview.html
      Holland9.com
    • 184. Testing / Debugging
      • Try to run it in the emulator.
      • 185. In system settings, turn on a location provider
      • 186. Add a refresh button and see the marker move after manipulating the location.
      • 187. Use Logcat view to show debug info.
      • 188. http://developer.android.com/guide/index.html
      Holland9.com
    • 189. Being Eric Schmidt
      • Now you decide ……..
      Holland9.com