This is the session number 6 in android course that started with java syntax. This presentation have many topics like (Android OS, Android Versions, Android architecture, Tools & Setups, How to start ?, Why Android Studio ?, Android Application File Structure, App main components, Android hello World, What is XML, Define a view in XML & Java, Common Widgets, Layouts.)
2. Session topics :-
• Android OS.
• Android Versions.
• Android architecture.
• Tools & Setups.
• How to start ?.
• Why Android Studio ?.
• Android Application File Structure.
• App main components.
• Android hello World.
• What is XML.
• Define a view in XML & Java.
• Common Widgets.
• Layouts.
3. Android OS :-
• The system developed by Android Inc which Google bought in 2005.
• OHA, Open Handset Alliance a group of companies was formed 2007.
• Android was released in 2007, with the first commercial Android device (1.0) launched in
September 2008.
Android
1.5
Android
7.1
Android
4.0
Android
10
Android
5.0
12. Why Android Studio ? :-
• The Android SDK tools compile your code and any resource files into an APK.
• Android Studio provides the fastest tools for building apps on every type of Android
device.
APK Analyzer Intelligent code editor
15. App main components :-
• Each component is an entry point through which the system or a user can enter your
app. There are four different types of app components:
Activities
Services
Broadcast receivers
Content providers
18. What is XML ? :-
• XML stands for Extensible Markup Language.
• XML is a markup language much like HTML designed to store and transport data with
focus on what data is.
• XML tags are not predefined like HTML tags.
<notification>
<date>2015-09-01</date>
<title>Wake Up</hour>
<content>Today I will go to
school</to>
</notification>
19. App main components :-
• Example :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a TextView" />
<Button android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a Button" />
</LinearLayout>
20. Define a view in XML & Java :-
• In XML :
<Button android:id="@+id/my_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/my_button_text"/>
• In Java:
Button myButton = (Button) findViewById(R.id.my_button);
25. Layouts :-
• Each element in the layout are built using a hierarchy of View and ViewGroup objects.
• A View in the android something that user can see and interact with.
• ViewGroup is an invisible container that defines the layout structure for View and other
ViewGroup objects, as shown in the following figure.
• The View usually called "widget" such as Button or TextView.
• The ViewGroup usually called "layout" such as LinearLayout.
ViewGroup
ViewGroup
View View View
View View