CS619 Android 101 BENCE CSERNA Android: Manifest example Android: - - PowerPoint PPT Presentation

cs619 android 101
SMART_READER_LITE
LIVE PREVIEW

CS619 Android 101 BENCE CSERNA Android: Manifest example Android: - - PowerPoint PPT Presentation

Project #1: Color Guess Game CS619 Android 101 BENCE CSERNA Android: Manifest example Android: Manifest <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="net.cserna.bence.colorguess


slide-1
SLIDE 1

CS619 Android 101

BENCE CSERNA

Project #1: Color Guess Game Android: Manifest

! Android application descriptor

! Permissions (Internet, Record sound, Send

text, Vibration)

! Every component is described here

! Activities should be added to Manifest (!)

Android: Manifest example

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="net.cserna.bence.colorguess” android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8” android:targetSdkVersion="17" /> <application android:icon="@drawable/ic_launcher” android:theme="@style/ AppTheme" > <activity android:name="net.cserna.bence.colorguess.GameActivity"> … </activity> <activity android:name="net.cserna.bence.colorguess.ResultActivity" android:label="@string/title_activity_result" > </activity> </application> </manifest>

slide-2
SLIDE 2

Android: Context

! Interface to global information about an

application environment.

! Every Activity or Service is a Context itself ! Context is required to start an Activity or a Service

Android: Activity

! UI Component

! Only one Activity can be active

! Java Class File

! UI is defined by XML (in most cases) ! Behavior is defined by java

! Managed Component

! It has a lifecycle managed by Android

system

Android: Intent

! Target

! Can be implicit or explicit

! Data

! Simple values (Integer, String, Lists, etc.) ! Complex objects

Android: Start Activity example

! Intent intent = new Intent(GameActivity.this, ResultActivity.class);

! intent.putExtra("score", correctAnswers); ! intent.putExtra("time", totalTime);

! startActivity(resultActivityIntent); ! Intent intent = getIntent(); ! final int score = intent.getIntExtra("score", -1); ! final long timeInMillis = intent.getLongExtra("time", -1);

slide-3
SLIDE 3

Quick OOP