01 07 -android programming basics (cont)

311 Aufrufe

Veröffentlicht am

Veröffentlicht in: Technologie
0 Kommentare
0 Gefällt mir
Statistik
Notizen
  • Als Erste(r) kommentieren

  • Gehören Sie zu den Ersten, denen das gefällt!

Keine Downloads
Aufrufe
Aufrufe insgesamt
311
Auf SlideShare
0
Aus Einbettungen
0
Anzahl an Einbettungen
4
Aktionen
Geteilt
0
Downloads
25
Kommentare
0
Gefällt mir
0
Einbettungen 0
Keine Einbettungen

Keine Notizen für die Folie

01 07 -android programming basics (cont)

  1. 1. Hello World Sample
  2. 2. Agenda Hello World !!! Interacting with Buttons Screen Navigation start Activity For Result Intents Activity Services Broadcast Receivers
  3. 3. Hello World !!! 1. Create a new Android Project ‫ﬤ‬ Select File > New > Android Project 2. Fill out the project details ‫ﬤ‬ Enter HelloWorld for Project Name ‫ﬤ‬ Select “Create new project in workspace” ‫ﬤ‬ Enter HelloWorld in App name. ‫ﬤ‬ Enter com.enlume.HelloWorld in Package Name ‫ﬤ‬ Enter HelloWorld in Activity name (and yes we want to create an Activity)
  4. 4. 5
  5. 5. 6
  6. 6. 7
  7. 7. 8
  8. 8. Interacting with Button 9
  9. 9. Interacting with Buttons 10
  10. 10. 11
  11. 11. Screen Navigation 12
  12. 12. 13
  13. 13. 14
  14. 14. 15
  15. 15. 16
  16. 16. 17
  17. 17. 18
  18. 18. Start Activity For Result
  19. 19. 20
  20. 20. 21
  21. 21. 22
  22. 22. 23
  23. 23. 24
  24. 24. Run hello world • Select the root of the project. • Click in the ‘green play icon’. • Pick Android Project • That will get the emulator going…
  25. 25. The Android Manifest lists application details <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android " package="com.my_domain.app.helloactivity"> <application android:label="@string/app_name"> <activity android:name=".HelloActivity"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application>
  26. 26. The Android Manifest File  This file must declare all activities, services, broadcast receivers and content provider of the application.  It must also contain the required permissions for the application. For example if the application requires network access it must be specified here  It can be thought as the deployment descriptor for an Android application.  The "package" attribute defines the base package for the following Java elements  "android:versionName" and "android:versionCode" specify the version of your application.  intent filter registered defines that this activity is started once the application starts (action android:name="android.intent.action.MAIN").  The category definition (category android:name="android.intent.category.LAUNCHER" ) defines that this application is added to the application directory on the Android device.  The "uses-sdk" part defines the minimal SDK version your application is valid for.
  27. 27. Questions?

×