cs619 android 101
play

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


  1. 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” android:versionCode="1" android:versionName="1.0" > ! Android application descriptor <uses-sdk android:minSdkVersion="8” android:targetSdkVersion="17" /> ! Permissions (Internet, Record sound, Send <application android:icon="@drawable/ic_launcher” android:theme="@style/ AppTheme" > text, Vibration) <activity android:name="net.cserna.bence.colorguess.GameActivity"> ! Every component is described here … </activity> ! Activities should be added to Manifest (!) <activity android:name="net.cserna.bence.colorguess.ResultActivity" android:label="@string/title_activity_result" > </activity> </application> </manifest>

  2. Android: Context Android: Activity ! UI Component ! Interface to global information about an application environment. ! Only one Activity can be active ! Every Activity or Service is a Context itself ! Java Class File ! Context is required to start an Activity or a Service ! 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 Android: Start Activity example ! Target ! Intent intent = new Intent(GameActivity.this, ResultActivity.class); ! intent.putExtra("score", correctAnswers); ! Can be implicit or explicit ! intent.putExtra("time", totalTime); ! Data ! startActivity(resultActivityIntent); ! Simple values (Integer, String, Lists, etc.) ! Intent intent = getIntent(); ! Complex objects ! final int score = intent.getIntExtra("score", -1); ! final long timeInMillis = intent.getLongExtra("time", -1);

  3. Quick OOP

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend