Android - Einführung - Lehrstuhl für Mobile und Verteilte Systeme

tibburfrogtownMobile - Wireless

Dec 14, 2013 (3 years and 5 months ago)

87 views

Prof. Dr. Claudia Linnhoff-Popien
Moritz Kessel, Kevin Wiesner
http://www.mobile.ifi.lmu.de
Wintersemester 2010/11
Praktikum Mobile und Verteilte Systeme
Android
Prof. Dr. C. Linnhoff-Popien, M. Kessel, K. Wiesner- PraktikumMobile und Verteilte Systeme
Wintersemester 2010/11, Android
What is Android?
2
Android
• A software stack for mobile devices
• Operating system
• Middleware
• Key applications
• Software development kit
• Based on Java programming language
• Using Dalvik virtual machine as run time
Prof. Dr. C. Linnhoff-Popien, M. Kessel, K. Wiesner- PraktikumMobile und Verteilte Systeme
Wintersemester 2010/11, Android
Android Architecture
3
Quelle: http://developer.android.com
Prof. Dr. C. Linnhoff-Popien, M. Kessel, K. Wiesner- PraktikumMobile und Verteilte Systeme
Wintersemester 2010/11, Android
Android Fundamentals
4
Every Android Application
• Has own process
• Has own virtual machine

Has certain permissions
Application Components
• Activities
• Services
• Broadcast receivers
• Content providers

Intents
Prof. Dr. C. Linnhoff-Popien, M. Kessel, K. Wiesner- PraktikumMobile und Verteilte Systeme
Wintersemester 2010/11, Android
Starting Activities and Services
5
Activities:
Intent myIntent = new Intent(MyActivity.this,MyOtherActivity.class);
Context.startActivity(myIntent);
Services:
Intent myIntent = new Intent(MyActivity.this, MyService.class);
Context.startService(myIntent);
Prof. Dr. C. Linnhoff-Popien, M. Kessel, K. Wiesner- PraktikumMobile und Verteilte Systeme
Wintersemester 2010/11, Android
Activity Life Cicle
6
Source: Android Developers,
http://developer.android.com/guide/topics/fundamentals.html
Prof. Dr. C. Linnhoff-Popien, M. Kessel, K. Wiesner- PraktikumMobile und Verteilte Systeme
Wintersemester 2010/11, Android
Android Manifest
7
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.lmu.ifi.mdsg.msp"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name="GSMActivity" android:label="@string/gsm_activity_name"></activity>
<activity android:name="GPSActivity" android:label="@string/gps_activity_name"></activity>
<activity android:name="EkahauActivity" android:label="@string/ekahau_activity_name"></activity>
<activity android:name="ChatClientActivity" android:label="@string/chatclient_activity_name"></activity>
<activity android:name="MSPClientActivity" android:label="@string/mspclient_activity_name"></activity>
<uses-library android:name="com.google.android.maps"/>
</application>
<uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
</manifest>
Prof. Dr. C. Linnhoff-Popien, M. Kessel, K. Wiesner- PraktikumMobile und Verteilte Systeme
Wintersemester 2010/11, Android
8
Android developer page:
• API reference
• Tutorial
• Developer guide
http://developer.android.com/
Android development in Eclipse:
• Create application
• Use layout manager
• Deploy on real device
http://www.vogella.de/articles/Android/article.html
Android book:
Android – Grundlagen und Programmierung
Arno Becker, Marcus Pant, dpunkt.Verlag, 2009
Getting Help