Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Overview
Introduction
to Android Development Tools Android Application Development Break 20 mins. User Interface Basic Layout Launch 1 hr.
Introduction to Android
Android Component
Development Tools
Eclipse Android SDK ADT Plugin for Eclipse
http://developer.android.com/resources/tut orials/hello-world.html
Install a Platform
In the Android SDK and AVD Manager, choose Available Packages in the left panel. In the right panel, expand the Android Repository list to display the components available for installation. Select at least one platform to install, and click Install Selected. If you aren't sure which platform to install, use the latest version.
Create an AVD
In Eclipse, select Window > Android SDK and AVD Manager. Select Virtual Devices in the left panel. Click New.... The Create New AVD dialog appears. Type the name of the AVD, such as "my_avd". Choose a target. The target is the platform (that is, the version of the Android SDK, such as 2.3.3) you want to run on the emulator. For this tutorial, choose the latest platform that you have installed and ignore the rest of the fields. Click Create AVD.
10
images
UI layouts constants Control Application
11
Work 1
Change
Hello World, MainActivity!
Add
strings.xml
12
toast
13
toast
Toast.makeText(getBaseContext(),R.string.hello,Toast.LENGTH_SHORT).show();
Toast.makeText(getBaseContext(),"test",Toast.LENGTH_LONG).show();
14
onKeyDown
public boolean onKeyDown(int keyCode, KeyEvent event) { switch(keyCode){ case KeyEvent.KEYCODE_0: Toast.makeText(getBaseContext(),"0",Toast.LENGTH_SHORT).show(); return true; case KeyEvent.KEYCODE_1: Toast.makeText(getBaseContext(),"1",Toast.LENGTH_SHORT).show(); return true; } return false; }
15
Work 2
0-9 toast
16
17
User Interface
18
User Interface
19
Work 3
20
Basic Layout
21
Linear Layout
22
Frame Layout
23
Relative Layout
24
Table Layout
25
Layout
26
Work 4
login form
27