android styles and themes

12
ANDROID Styles and Themes

Upload: deepa-rani

Post on 24-Jan-2015

93 views

Category:

Education


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Android   styles and themes

ANDROID Styles and Themes

Page 2: Android   styles and themes

Introduction

A style is a collection of properties that specify the look and format for a view or Window.

A Style can define Height, Font Color, Font size, Back ground color etc

Page 3: Android   styles and themes

Install Platform

To install a platform in Eclipse:Step: 1 Go to Window In the Android SDK and AVD Manager, choose Available Packages in the left panel.

Step: 2 Click the repository site checkbox to display the components available for installation.

Step: 3 Select at least one platform to install, and click Install Selected. If you aren't sure which platform to install, use the latest version.

Install Platform

Page 4: Android   styles and themes

Create an AVDCreate an AVD

Before we launch Android Emulator we must create an Android Virtual device[AVD] AVD defines the system image and device setting used by the emulator. To Create an AVD:1. In Eclipse, choose Window > Android SDK and AVD Manager.2. Select Virtual Devices in the left panel.3. Click New. The Create New AVD dialog appears.

4. Type the name of the AVD, such as "my_avd".5. Choose a target. The target is the platform (that is, the version of the Android SDK, such as 2.1) you want to run on the emulator.You can ignore the rest of the fields for now.6. Click Create AVD.

Page 5: Android   styles and themes

Create a New projectCreate a New project

After you've created an AVD, the next step is to start a new Android project in Eclipse1. From Eclipse, select File > New > Project.If the ADT Plug-in for Eclipse has been successfully installed, the resulting dialog should have a folder labelled "Android" which should contain "Android Project". (After you create one or more Android projects, an entry for "Android XML File" will also be available.)

Page 6: Android   styles and themes

Create a New projectCreate a New project

2. Select "Android Project" and click Next.

Page 7: Android   styles and themes

Create a New projectCreate a New project

3. Fill in the project details with the following values:Project name: HelloAndroidApplication name: Hello, AndroidPackage name: com.example.helloandroid (or your own private namespace)Create Activity: HelloAndroidClick Finish.

Page 8: Android   styles and themes

Create a New projectCreate a New projectHere is a description of each field:

Field Description

Project Name

This is the Eclipse Project name — the name of the directory that will contain the project files.

Application Name

This is the human-readable title for your application — the name that will appear on the Android device.

Package Name

This is the package namespace(following the same rules as for packages in the Java programming lang) that you want all your source code to reside under.Note:every package name must be unique across all packages installed on the Android system;

Create Activity

This is the name for the class stub that will be generated by the plugin.

Min SDK Version

This value specifies the minimum API Level required by your application.

Page 9: Android   styles and themes

Activity - IntroductionActivity - Introduction

Where to find Activity in the above created project?Ans: HelloAndroid > src > com.example.helloandroidIt should look like:

1. An Activity is a single application entity that is used to perform actions2. An application may have many separate activities, but the user interacts with them one at a time.3. An activity is not required to have a user interface, but usually will.

Step-1 in Hello world App

Page 10: Android   styles and themes

Construct the UI

These three lines are responsible for

showing the ‘Hello, Android’ Text on the TextView placed in

Android Design View.

Tip: An easy way to add import packages to your project is to press Ctrl-Shift-O

Page 11: Android   styles and themes

Android API Levels

What is API Level?API Level is an integer value that uniquely identifies the framework API revision offered by a version of the Android platform.

Page 12: Android   styles and themes

Run the applicationThe Eclipse plugin makes it easy to run your applications:Select Run > Run.Select "Android Application".