Android Application Framework
-
Upload
danny-fuerniss -
Category
Education
-
view
699 -
download
0
description
Transcript of Android Application Framework
Dann
y Für
niß,
28.
10..2
012,
1
Programmierungvon Apps
Android Application Framework
Dann
y Für
niß,
28.
10..2
012,
2
Die Studierenden kennen die Bausteine des
Android Application Framework und verstehen, wie sich daraus eine Android App zusammen-
bauen lässt.
Dann
y Für
niß,
28.
10..2
012,
3
AndroidApplication Framework
Bildquelle: http://s31.a2zinc.net/clients/ezlandscape/congress12/public/Content.aspx?ID=3577&sortMenu=104000
Dann
y Für
niß,
28.
10..2
012,
4
Bildquelle: http://developer.android.com/guide/basics/what-is-android.html
BAUSTEINE
Dann
y Für
niß,
28.
10..2
012,
5
Woraus besteht eine Android App?
Bildquelle: http://ecom-software.com/2114-android-mega-games-pack-87-games-july-2011-pdu.html
Dann
y Für
niß,
28.
10..2
012,
6
Kontext Sicht
Dann
y Für
niß,
28.
10..2
012,
7
Black Box Sicht
Dann
y Für
niß,
28.
10..2
012,
8
Black Box Sicht
AndroidManifest.xml
Activities/Services
BroadcastReceivers
ContentProviders
Dann
y Für
niß,
28.
10..2
012,
9
Black Box Sicht
AndroidManifest.xml
Activities/Services
BroadcastReceivers
ContentProviders
Dann
y Für
niß,
28.
10..2
012,
10
AndroidManifest.xml<manifest
package=„com.dfuerniss.app“<uses-permission><uses-feature><supports-screens><application>
<activitiy><service><receiver><provider>
<uses-sdk>…
Dann
y Für
niß,
28.
10..2
012,
11
<manifest>
packagexmlns:androidversionCodeversionNameinstallLocation…
http://developer.android.com/guide/topics/manifest/manifest‐intro.html
Dann
y Für
niß,
28.
10..2
012,
12
<uses-permission>
http://developer.android.com/reference/android/Manifest.permission.html
android.permission.INTERNETandroid.permission.ACCESS_NETWORK_STATEandroid.permission.USE_CREDENTIALSandroid.permission.AUTHENTICATE_ACCOUNTSandroid.permission.READ_CONTACTSandroid.permission.WRITE_CONTACTSandroid.permission.WRITE_EXTERNAL_STORAGE…
Dann
y Für
niß,
28.
10..2
012,
13
Application Object
Klassepublic class PVAUebungApplication extends application…
AndroidManifest.xml<application android:name=„PVAUebungApplication“…
Dann
y Für
niß,
28.
10..2
012,
14
Resources
Dann
y Für
niß,
28.
10..2
012,
15
Resource Types
Quelle: http://developer.android.com/guide/topics/resources/providing-resources.html
res/animatorres/animres/color
res/drawableres/layoutres/menures/rawres/valuesres/xml
Dann
y Für
niß,
28.
10..2
012,
16
Resource Qualifiers
Quelle: http://developer.android.com/guide/topics/resources/providing-resources.html
Language/Region
Screen‐Size
Screen‐Orientation
Platform‐Version
etc.
/values‐en‐rUS
/layout‐xlarge
/layout‐land
/color‐v13
etc.
Dann
y Für
niß,
28.
10..2
012,
17
R.java (generated)public final class R {public static final class color {public static final int background_gradient_66=0x7f060001;public static final int bar_color=0x7f060003;
}public static final class dimen {public static final int text_size_large=0x7f070004;public static final int text_size_small=0x7f070002;
}public static final class drawable {public static final int chart_bar_gradient_co2=0x7f020001;public static final int chart_bar_gradient_gp=0x7f020002;public static final int chart_bar_gradient_ht=0x7f020003;public static final int chart_bar_gradient_nt=0x7f020004;
}}
Dann
y Für
niß,
28.
10..2
012,
18
Activities
Dann
y Für
niß,
28.
10..2
012,
19
Siehe auch „Learning Android“, S. 29
ActivityLifecycle
Dann
y Für
niß,
28.
10..2
012,
20
onSaveInstanceState()
onCreate(Bundle savedInstanceState)
Dann
y Für
niß,
28.
10..2
012,
21
Fragments
Dann
y Für
niß,
28.
10..2
012,
22
FragmentLifecycle
Dann
y Für
niß,
28.
10..2
012,
23
Loaders
Dann
y Für
niß,
28.
10..2
012,
24
Intents
Dann
y Für
niß,
28.
10..2
012,
25
Explizite Intents
Dann
y Für
niß,
28.
10..2
012,
26
Implizite Intents
Dann
y Für
niß,
28.
10..2
012,
27
PendingIntent
Intent intent = new Intent(context, DashboardActivity.class)
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent,
PendingIntent.FLAG_ONE_SHOT)
Dann
y Für
niß,
28.
10..2
012,
28
startActivityForResult()
Dann
y Für
niß,
28.
10..2
012,
29
Services
Dann
y Für
niß,
28.
10..2
012,
30
Services
Threading berücksichtigen!
Dann
y Für
niß,
28.
10..2
012,
31
Local Service
Dann
y Für
niß,
28.
10..2
012,
32
Remote Service
Dann
y Für
niß,
28.
10..2
012,
33
Intent Service
public class FetchDataService extends IntentService
Dann
y Für
niß,
28.
10..2
012,
34
Broadcast Receivers
Dann
y Für
niß,
28.
10..2
012,
35
Konfiguration über Intent-Filter
Permission ACCESS_NETWORK_STATE notwendig
Dann
y Für
niß,
28.
10..2
012,
36
Content Providers
Dann
y Für
niß,
28.
10..2
012,
37
ContentProvider
Dann
y Für
niß,
28.
10..2
012,
38
Portions of this presentation are modifications based on work created and shared by Google and used according
to terms described in the Creative Commons 3.0
Attribution License.