Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Android SDK Download Android Studio from https://developer.android.com/studio/index.html File New Import (Folder of Note Project) Java Class Xml Layout Android Manifest Build.gradle Basic parts of Android Studio Projects • Manifext.xml • Java Code • XML Layout Manifest • Every Android application should contain a manifest file • It contains 1. 2. 3. Java Package Name Components of the app: Activities, Services, Content Providers, Broadcast Receivers Permissions for the app MainActivity.java package com.example.notetaker; import android.app.Activity; import android.os.Bundle; public class HelloActivity extends Activity { /* Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } 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 • LinearLayout 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 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 RelativeLayout area (aligned to the bottom, left of center). 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 columns like html 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 ?