Android Studio Hello World StartAll ProgramAndroid Studio I

  • Slides: 43
Download presentation
Android Studio Hello World

Android Studio Hello World

Start/All Program/Android Studio

Start/All Program/Android Studio

I do not have a previous version … OK

I do not have a previous version … OK

Click update (wait a long time)

Click update (wait a long time)

Update and restart

Update and restart

Next

Next

Next (again)

Next (again)

Finish

Finish

Finish (again)

Finish (again)

Start a new Android Studio project

Start a new Android Studio project

Name the application and click Next

Name the application and click Next

Select a minimum SDK. Next.

Select a minimum SDK. Next.

Next

Next

Choose an empty activity. Next

Choose an empty activity. Next

Finish

Finish

Close tip of the day

Close tip of the day

Click the Run App button (green arrow)

Click the Run App button (green arrow)

Click on create New Virtual Device

Click on create New Virtual Device

Next

Next

Select a system image

Select a system image

Agree to license. Next.

Agree to license. Next.

Finish

Finish

Select image. Next.

Select image. Next.

Finish

Finish

OK

OK

Install and continue

Install and continue

Finish

Finish

After closing the emulator and running again

After closing the emulator and running again

Go to activity_main. xml (see res/layout)

Go to activity_main. xml (see res/layout)

Right click on “Hello world” Text. View and select Cut.

Right click on “Hello world” Text. View and select Cut.

Click ON the Auto Connect (U) button

Click ON the Auto Connect (U) button

Drag a button from the palette to the layout

Drag a button from the palette to the layout

Change the button’s id and text

Change the button’s id and text

Drag a Text. View onto the Layout

Drag a Text. View onto the Layout

Change the Text. View’s id and text

Change the Text. View’s id and text

Return to Main. Activity – begin to instantiate a button object

Return to Main. Activity – begin to instantiate a button object

Put mouse over Button (which was red) and click Alt-Enter. Adds the import android.

Put mouse over Button (which was red) and click Alt-Enter. Adds the import android. widget. Button

Start adding the button’s set. On. Click. Listener method

Start adding the button’s set. On. Click. Listener method

Add required on. Click method

Add required on. Click method

Instantiate Text. View object and use its set. Text method

Instantiate Text. View object and use its set. Text method

Run • Problem you may find: the Text. View and Button may be on

Run • Problem you may find: the Text. View and Button may be on top of one another. • Return to layout and move things around (hoping to alleviate this problem)

Change to Text view of Layout. Notice the Text. View is underlined squiggly red.

Change to Text view of Layout. Notice the Text. View is underlined squiggly red. It is not constrained.

Code to constraint Text. View

Code to constraint Text. View