Android SDK Download Android Studio from https developer

  • Slides: 16
Download presentation
Android SDK Download Android Studio from https: //developer. android. com/studio/index. html File New Import

Android SDK Download Android Studio from https: //developer. android. com/studio/index. html File New Import (Folder of Note Project)

Java Class

Java Class

Xml Layout

Xml Layout

Android Manifest

Android Manifest

Build. gradle

Build. gradle

Basic parts of Android Studio Projects • Manifext. xml • Java Code • XML

Basic parts of Android Studio Projects • Manifext. xml • Java Code • XML Layout

Manifest • Every Android application should contain a manifest file • It contains 1.

Manifest • Every Android application should contain a manifest file • It contains 1. Java Package Name 2. Components of the app: Activities, Services, Content Providers, Broadcast Receivers 3. Permissions for the app

Main. Activity. java package com. example. notetaker; import android. app. Activity; import android. os.

Main. Activity. java package com. example. notetaker; import android. app. Activity; import android. os. Bundle; public class Hello. Activity extends Activity { /* Called when the activity is first created. */ @Override public void on. Create(Bundle saved. Instance. State) { super. on. Create(saved. Instance. State); set. Content. View(R. layout. main); } }

Layout Two ways to define the UI • Define the UI elements in XML

Layout Two ways to define the UI • Define the UI elements in XML • Instantiate the UI elements at runtime Different Types of Layout • • • Linear Layout Relative Layout Frame Layout Table Layout Absolute Layout Grid Layout

Linear Layout • Linear. Layout is a view group that aligns all children in

Linear Layout • Linear. Layout is a view group that aligns all children in a single direction, vertically or horizontally. • You can specify the layout direction with the android: orientation attribute. Horizontal Layout Vertical Layout

Relative Layout • View group that displays child views in relative positions • The

Relative Layout • View group that displays child views in relative positions • The position of each view can be specied as relative to sibling elements (left-of or below another view) • Or positions can be specied relative to the parent Relative. Layout area (aligned to the bottom, left of center).

Frame Layout • Generally meant for holding one child • Will happily stack up

Frame Layout • Generally meant for holding one child • Will happily stack up other elements with respect to the parent container i. e. itself • Generally used for manipulating the z-index of different elements (overlay elements)

Table Layout • Allows you to define the layout in terms of rows and

Table Layout • Allows you to define the layout in terms of rows and columns like html

Directory Structrure manifest The manifest file describes the fundamental characteristics of the app and

Directory Structrure manifest The manifest file describes the fundamental characteristics of the app and defines each of its components src/ Directory for your app's main source files. By default, it includes an Activity class that runs when your app is launched using the app icon. res/ Contains several sub-directories for app resources. Here are just a few: drawable/ A drawable resource is a general concept for a graphic that can be drawn to the screen layout/ Files that define your app's user interface. values/ Directory for other various XML files that contain a collection of resources, such as string and color definitions.

Questions ?

Questions ?