• Like
  • Save
Computer Science E-69 Smartphone Application Development
Upcoming SlideShare
Loading in...5
×
 

Computer Science E-69 Smartphone Application Development

on

  • 1,338 views

 

Statistics

Views

Total Views
1,338
Views on SlideShare
1,337
Embed Views
1

Actions

Likes
0
Downloads
18
Comments
0

1 Embed 1

http://www.slideshare.net 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Computer Science E-69 Smartphone Application Development Computer Science E-69 Smartphone Application Development Presentation Transcript

    • Computer Science E-69 Smartphone Application Development Lecture 6: [Android] Activities & Tasks March 2, 2010 Dan Armendariz danallan@mit.edu 1
    • package com.android.helloworld; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class HelloWorld extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        TextView tv = new TextView(this);        tv.setText("Hello, World!");        setContentView(tv);    } } Code adapted from: http://developer.android.com/resources/tutorials/hello-world.html Android Hello, World! 2
    •  public class Activity extends ApplicationContext {      protected void onCreate(Bundle savedInstanceState);      protected void onStart();            protected void onRestart();      protected void onResume();      protected void onPause();      protected void onStop();      protected void onDestroy();  } http://developer.android.com/reference/android/app/Activity.html Activities Methods 3
    • http://developer.android.com/reference/android/app/Activity.html Activity Lifecycle 4
    • TextView tv = new TextView(this); tv.setText("Hello, Android"); – or – <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android"   android:layout_width="fill_parent"   android:layout_height="fill_parent"   android:text="@string/hello"/> http://developer.android.com/resources/tutorials/hello-world.html Activity Creating a UI 5
    • http://developer.android.com/guide/topics/ui/index.html Views Layouts 6
    • FrameLayout Gallery GridView LinearLayout ListView RelativeLayout ScrollView Spinner SurfaceView TabHost TableLayout ViewFlipper ViewSwitcher More: http://developer.android.com/reference/android/widget/package-summary.html Views Common Layouts 7
    • Computer Science E-69 Smartphone Application Development Lecture 6: [Android] Activities & Tasks March 2, 2010 Dan Armendariz danallan@mit.edu 8