Android 101 workshop

912 views

Published on

Slides for my Android 101 session at the 2012 Berlin DevFest.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
912
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
11
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Android 101 workshop

  1. 1. Android 101 workshopGetting started with Android development
  2. 2. Benjamin Weisshttp://gplus.to/keyboardsurferTwitter: @keyboardsurferSenior Software Developerat ImmobilienScout24Organizer: GDG Android in BerlinCo-Organizer: ●Global Android Dev Camp ●GTUG Community Weekend ●Google I/O Extended Berlin 2012 ●DevFest Berlin 2012
  3. 3. Agenda● The Setup● Hello Android● AndroidManifest.xml● Intents● Views● Respond to user-interaction● Using libraries● Hands on
  4. 4. The SetupPlatform of choiceLinuxMacWindowsAndroid
  5. 5. The Setup Development Environment http://eclipse.org https://www.jetbrains.com/idea AIDE https://play.google.com/store/apps/details? id=com.aide.ui
  6. 6. The SetupAndroid SDKhttps://developer.android.com/sdk/index.html
  7. 7. Hello Android
  8. 8. AndroidManifest.xmlhttps://developer.android.com/ guide/topics/manifest/ manifest-intro.html
  9. 9. AndroidManifest.xml<manifest> <activity-alias> <uses-permission /> <intent-filter> . . . </intent-filter> <permission /> <meta-data /> <permission-tree /> </activity-alias> <permission-group /> <instrumentation /> <service> <uses-sdk /> <intent-filter> . . . </intent-filter> <uses-configuration /> <meta-data/> <uses-feature /> </service> <supports-screens /> <compatible-screens /> <receiver> <supports-gl-texture /> <intent-filter> . . . </intent-filter> <meta-data /> <application> </receiver> <activity> <provider> <intent-filter> <grant-uri-permission /> <action /> <meta-data /> <category /> </provider> <data /> </intent-filter> <uses-library /> <meta-data /> </activity> </application> </manifest>
  10. 10. AndroidManifest.xml<manifest> <activity-alias> <uses-permission /> <intent-filter> . . . </intent-filter> <permission /> <meta-data /> <permission-tree /> </activity-alias> <permission-group /> <instrumentation /> <service> <uses-sdk /> <intent-filter> . . . </intent-filter><manifest xmlns:android= "http://schemas.android. <uses-configuration /> <meta-data/> <uses-feature /> </service>com/apk/res/android" <supports-screens /> android:installLocation="auto" <receiver> <compatible-screens /> <intent-filter> . . . </intent-filter> <supports-gl-texture /> package="my.package.name" <meta-data /> </receiver> android:versionCode="42" <application> android:versionName="theLifeTheUniverseAndEverything-Beta" <activity> <provider> <intent-filter> <grant-uri-permission />> <action /> <meta-data /> <category /> </provider> <data /> </intent-filter> <uses-library /> <meta-data /> </activity> </application> </manifest>
  11. 11. AndroidManifest.xml<manifest> <activity-alias> <uses-permission /> <intent-filter> . . . </intent-filter> <permission /> <meta-data /> <permission-tree /> </activity-alias> <permission-group /> <instrumentation /> <service> <uses-sdk /> <intent-filter> . . . </intent-filter> <uses-configuration /> <meta-data/> </service> <uses-feature /> <uses-permission /> <supports-screens /> <compatible-screens /> <receiver> <supports-gl-texture /> <intent-filter> . . . </intent-filter> <meta-data /> <application> </receiver> <activity> <provider> <intent-filter> <grant-uri-permission /> <action /> <meta-data /> <category /> </provider> <data /> </intent-filter> <uses-library /> <meta-data /> </activity> </application> </manifest>
  12. 12. AndroidManifest.xml<manifest> <activity-alias> <uses-permission /> <intent-filter> . . . </intent-filter> <permission /> <meta-data /> <permission-tree /> </activity-alias> <permission-group /> <instrumentation /> <service> <uses-sdk /> <intent-filter> . . . </intent-filter> <meta-data/> ! <uses-configuration /> </service> <uses-feature /> <uses-permission /> <supports-screens /> <compatible-screens /> <receiver> <supports-gl-texture /> <intent-filter> . . . </intent-filter> <meta-data /> <application> </receiver> <activity> <provider> <intent-filter> <grant-uri-permission /> <action /> <meta-data /> <category /> </provider> <data /> </intent-filter> <uses-library /> <meta-data /> </activity> </application> </manifest>
  13. 13. AndroidManifest.xml<manifest> <activity-alias> <uses-permission /> <intent-filter> . . . </intent-filter> <permission /> <meta-data /> <permission-tree /> <activity> </activity-alias> <permission-group /> <instrumentation /> <intent-filter> <service> <uses-sdk /> <action /> <intent-filter> <meta-data/> . . . </intent-filter> <uses-configuration /> <uses-feature /> <category /> </service> <supports-screens /> <compatible-screens /> <data /> <receiver> <supports-gl-texture /> </intent-filter> <intent-filter> . . . </intent-filter> <meta-data /> <application> <meta-data </receiver> /> </activity> <provider> <activity> <intent-filter> <grant-uri-permission /> <action /> <meta-data /> <category /> </provider> <data /> </intent-filter> <uses-library /> <meta-data /> </activity> </application> </manifest>
  14. 14. AndroidManifest.xml<manifest> <activity-alias> <uses-permission /> <intent-filter> . . . </intent-filter> <permission /> <meta-data /> <permission-tree /> <activity> </activity-alias> <permission-group /> <instrumentation /> <intent-filter> <service> <uses-sdk /> <action /> <intent-filter> <meta-data/> . . . </intent-filter> ! <uses-configuration /> <uses-feature /> <category /> </service> <supports-screens /> <compatible-screens /> <data /> <receiver> <supports-gl-texture /> </intent-filter> <intent-filter> . . . </intent-filter> <meta-data /> <application> <meta-data </receiver> /> </activity> <provider> <activity> <intent-filter> <grant-uri-permission /> <action /> <meta-data /> <category /> </provider> <data /> </intent-filter> <uses-library /> <meta-data /> </activity> </application> </manifest>
  15. 15. IntentAn intent is an abstract description of anoperation to be performed.It can be used with startActivity to launchan Activity, broadcastIntent to send itto any interested BroadcastReceivercomponents, and startService(Intent)or bindService(Intent,ServiceConnection, int) tocommunicate with a background Service.
  16. 16. IntentAn intent is an abstract description of anoperation to be performed.It can be used with startActivity to launchan Activity, broadcastIntent to send itto any interested BroadcastReceivercomponents, and startService(Intent)or bindService(Intent,ServiceConnection, int) tocommunicate with a background Service.
  17. 17. IntentAn Intent provides a facility for performing lateruntime binding between the code in differentapplications.Its most significant use is in the launching ofactivities, where it can be thought of as theglue between activities.It is basically a passive data structure holdingan abstract description of an action to beperformed.
  18. 18. IntentAn Intent provides a facility for performing lateruntime binding between the code in differentapplications.Its most significant use is in the launching ofactivities, where it can be thought of as theglue between activities.It is basically a passive data structure holdingan abstract description of an action to beperformed.
  19. 19. Intent
  20. 20. Views<?xml version ="1.0" encoding ="utf-8"?><LinearLayout xmlns:android ="http://schemas.android.com/apk/res/android" android:layout_width ="fill_parent" android:layout_height ="fill_parent" android:paddingLeft ="16dp" android:paddingRight ="16dp" android:orientation ="vertical" > <EditText android:layout_width ="fill_parent" android:layout_height ="wrap_content" android:hint ="@string/to" /> <EditText android:layout_width ="fill_parent" android:layout_height ="wrap_content" android:hint ="@string/subject" /> <EditText android:layout_width ="fill_parent" android:layout_height ="0dp" android:layout_weight ="1" android:gravity ="top" android:hint ="@string/message" /> <Button android:layout_width ="100dp" android:layout_height ="wrap_content" android:layout_gravity ="right" android:text ="@string/send" /></LinearLayout>
  21. 21. Viewspublic class OneOhOneDemo extends Activity{ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); }...}
  22. 22. Views
  23. 23. User interaction someView.setOnClickListener(new OnClickListener() { public void onClick(View view) { //handle event } });
  24. 24. Libraries
  25. 25. Libraries ● Support Library ● android-json-rpc ● oauth-signpost ● greenDAO ● GSON ● ...
  26. 26. Important linkshttps://developer.android.comhttps://developer.android.com/sdk/index.htmlhttps://developer.android.com/guide/components/index.htmlhttps://developer.android.com/training/basics/firstapp/index.htmlhttps://stackoverflow.comhttp://www.openintents.org/en/libraries
  27. 27. Questions
  28. 28. Get your keyboards clicking!
  29. 29. Thank youBenjamin Weisshttp://gplus.to/keyboardsurferTwitter: @keyboardsurfer
  30. 30. Image Sources● http://www.devfest.info/images/vhabig.png● https://en.wikipedia.org/wiki/Linux● https://en.wikipedia.org/wiki/Windows● https://en.wikipedia.org/wiki/Windows● https://d.android.com● http://www.eclipse.org/artwork/● https://www.jetbrains.com/img/logos/logo_intellij_idea.gif● https://play.google.com/store/apps/details?id=com.aide.ui● https://developer.android.com/sdk/index.html● https://developer.android.com/reference/packages.html● https://developer.android.com/guide/topics/ui/layout/linear.html● http://curiousexpeditions.org/?p=78● http://actionbarsherlock.com● https://code.google.com/p/roboguice● http://marie-schweiz.de

×